tmpl-fastapi/app/main.py

25 lines
440 B
Python

from typing import List, Type
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from . import common
# 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=common.static_dir),
name='static',
)
for p in paths:
p(app).add_paths()