StaticRouter
A static file routing solution for FastAPI.
import static_router
from static_router.loaders import StaticContentLoader
from fastapi import FastAPI
app = FastAPI()
# Other such fastapi things as required
# ...
loader = StaticContentLoader(directory="content")
static_router.register(app, content_loader=loader)
In your templates, you may access the following variables:
page- This contains any frontmatter you have defined in your markdown contentrouter- The content router instance
Release files for static_router 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| static_router-0.1.0.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| static_router-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.5 kB
Release files / static_router-0.1.0.tar.gz
| Download URL | static_router-0.1.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ad8d3c6e5b3d1bb6bdd1817c4bfac5ea9cb8dea864a4151e2e56642c1c4dea0
|
|
BLAKE2b-256 checksum How to use checksums |
1b1ed218fff8a480e8bfad01c4bcae5d61dbb6e535a47de907c862e45f214e9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.10.11 Darwin/21.6.0
|
Release files / static_router-0.1.0-py3-none-any.whl
| Download URL | static_router-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80bbdeba9f78014fafe47d293dff0c52bcc0e328d5c7d4d1f8746c3136f3dca4
|
|
BLAKE2b-256 checksum How to use checksums |
7862b1304e6d4a323129f16e2e5071c4694efdf772c23bbfdffda8251cb13802
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.10.11 Darwin/21.6.0
|