add function add startup
This commit is contained in:
@@ -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 !"}
|
Reference in New Issue
Block a user