tmpl-fastapi/app/main.py

26 lines
440 B
Python
Raw Normal View History

from typing import List, Type
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
2023-02-19 15:19:18 +03:00
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',
2023-02-19 15:19:18 +03:00
StaticFiles(directory=common.static_dir),
name='static',
)
for p in paths:
p(app).add_paths()