19 lines
446 B
Python
19 lines
446 B
Python
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")
|
|
user_add.add(username="Robert80", password="titi", roles="User")
|
|
|
|
@app.get("/")
|
|
async def root():
|
|
return {"message": "Hello World !"} |