-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (22 loc) · 829 Bytes
/
main.py
File metadata and controls
29 lines (22 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from app.database import models
from app.database.database import engine
from app.dependencies import (
MEDIA_PATH, STATIC_PATH, templates)
from app.routers import agenda, api, event, profile
models.Base.metadata.create_all(bind=engine)
app = FastAPI()
app.mount("/static", StaticFiles(directory=STATIC_PATH), name="static")
app.mount("/media", StaticFiles(directory=MEDIA_PATH), name="media")
app.include_router(api.router)
app.include_router(api.key_gen_router)
app.include_router(profile.router)
app.include_router(event.router)
app.include_router(agenda.router)
@app.get("/")
async def home(request: Request):
return templates.TemplateResponse("home.html", {
"request": request,
"message": "Hello, World!"
})