18 lines
435 B
Python
18 lines
435 B
Python
|
from fastapi import FastAPI
|
||
|
|
||
|
from config.config import initiate_database
|
||
|
from routes.request import router as RequestRouter
|
||
|
from routes.admin import router as AdminRouter
|
||
|
from config import Settings
|
||
|
|
||
|
app = FastAPI()
|
||
|
|
||
|
@app.on_event("startup")
|
||
|
async def start_database():
|
||
|
await initiate_database()
|
||
|
|
||
|
|
||
|
app.include_router(RequestRouter, tags=["Requests"])
|
||
|
|
||
|
if Settings().ENV == "dev":
|
||
|
app.include_router(AdminRouter, tags=["Admin"])
|