22 lines
550 B
Python
22 lines
550 B
Python
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
|
|
}
|
|
} |