add function add startup

This commit is contained in:
2023-10-13 21:44:30 +02:00
parent 6b0a5a7b65
commit 680634aeee
5 changed files with 24 additions and 2 deletions

View File

@@ -1,13 +1,18 @@
from fastapi import FastAPI
from .routers import users, token
from .dependencies import user_add
app = FastAPI()
app.include_router(users.router)
app.include_router(token.router)
@app.on_event("startup")
async def startup_event():
user_add.add(username="Peter93", password="toto", roles="Admin")
@app.get("/")
async def root():
return {"message": "Hello World !"}