tmpl-fastapi/app/main.py

25 lines
450 B
Python

from typing import List, Type
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from .common import settings
# Add your paths here
from .paths import Paths
from . import pages
from . import errors
paths: List[Type[Paths]] = [
pages.MainPaths,
errors.ErrorsPaths,
]
app = FastAPI()
app.mount(
'/static',
StaticFiles(directory=settings.static_dir),
name='static',
)
for p in paths:
p(app).add_paths()