feat(api): use routers for different api routes
This commit is contained in:
parent
285d11c0ab
commit
363aa37365
0
backend/src/neo_neo_todo/control/__init__.py
Normal file
0
backend/src/neo_neo_todo/control/__init__.py
Normal file
8
backend/src/neo_neo_todo/control/control.py
Normal file
8
backend/src/neo_neo_todo/control/control.py
Normal file
@ -0,0 +1,8 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter(prefix="/control", tags=["control"])
|
||||
|
||||
|
||||
@router.get("/ping")
|
||||
async def ping():
|
||||
return {"ping": "pong"}
|
@ -1,8 +1,8 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
from src.neo_neo_todo.control import control
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/control/ping")
|
||||
async def root():
|
||||
return {"ping": "pong"}
|
||||
app.include_router(control.router)
|
||||
|
Loading…
x
Reference in New Issue
Block a user