-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
41 lines (33 loc) · 1.21 KB
/
main.py
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
30
31
32
33
34
35
36
37
38
39
40
41
from __future__ import annotations
import fastapi as _fastapi
from fastapi.staticfiles import StaticFiles
from config.description import description
from control.user import admin_account
from database.models import create_tables
from endpoints import chat, dish, email, html, menu, order, submenu, task, user
app = _fastapi.FastAPI(
title="FastAPI Application",
description=description,
)
app.mount("/static", StaticFiles(directory="static"), name="static")
@app.on_event("startup")
async def startup_event():
await create_tables()
await admin_account()
app.include_router(
task.router,
prefix="/api/v1",
tags=["Get menu as Excel file"],
)
app.include_router(
email.router,
prefix="/api/v1",
tags=["Emails"],
)
app.include_router(user.router, prefix="/api/v1/user", tags=["User"])
app.include_router(order.router, prefix="/api/v1/order", tags=["Order"])
app.include_router(menu.router, prefix="/api/v1/menus", tags=["Menus"])
app.include_router(submenu.router, prefix="/api/v1/menus", tags=["Submenus"])
app.include_router(dish.router, prefix="/api/v1/menus", tags=["Dishes"])
app.include_router(chat.router, prefix="", tags=["Chat"])
app.include_router(html.router, prefix="", tags=["HTML"])