Update code in endpoints/route.get.py
This commit is contained in:
parent
6b7d7e2733
commit
33ce7a2641
@ -0,0 +1,22 @@
|
|||||||
|
from fastapi import APIRouter, HTTPException
|
||||||
|
from fastapi.requests import Request
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
routes = [] # In-memory storage
|
||||||
|
|
||||||
|
@router.get("/route")
|
||||||
|
async def get_route(request: Request):
|
||||||
|
"""Demo route endpoint"""
|
||||||
|
if request.method != "GET":
|
||||||
|
raise HTTPException(status_code=405, detail="Method not allowed")
|
||||||
|
|
||||||
|
return {
|
||||||
|
"message": "Route retrieved successfully",
|
||||||
|
"method": "GET",
|
||||||
|
"_verb": "get",
|
||||||
|
"features": {
|
||||||
|
"rate_limit": 100,
|
||||||
|
"expires_in": 3600
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user