2023-10-10 22:39:23 +02:00
|
|
|
from fastapi import FastAPI
|
|
|
|
|
2023-10-15 16:17:37 +02:00
|
|
|
from .routers import users, token, mail
|
2023-10-13 21:44:30 +02:00
|
|
|
from .dependencies import user_add
|
2023-10-11 23:45:12 +02:00
|
|
|
|
2023-10-10 22:39:23 +02:00
|
|
|
app = FastAPI()
|
|
|
|
|
|
|
|
app.include_router(users.router)
|
2023-10-12 00:04:18 +02:00
|
|
|
app.include_router(token.router)
|
2023-10-15 16:17:37 +02:00
|
|
|
app.include_router(mail.router)
|
2023-10-10 22:39:23 +02:00
|
|
|
|
2023-10-13 21:44:30 +02:00
|
|
|
|
|
|
|
@app.on_event("startup")
|
|
|
|
async def startup_event():
|
|
|
|
user_add.add(username="Peter93", password="toto", roles="Admin")
|
2023-10-13 22:18:41 +02:00
|
|
|
user_add.add(username="Robert80", password="titi", roles="User")
|
2023-10-13 21:44:30 +02:00
|
|
|
|
2023-10-10 22:39:23 +02:00
|
|
|
@app.get("/")
|
|
|
|
async def root():
|
|
|
|
return {"message": "Hello World !"}
|