Update code in endpoints/new-endpoint.post.py
This commit is contained in:
parent
23acf12ebb
commit
9de76cdd4c
@ -0,0 +1,25 @@
|
||||
from fastapi import APIRouter, HTTPException
|
||||
|
||||
endpoints = [] # In-memory storage
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.post("/new-endpoint")
|
||||
async def get_endpoints_demo(
|
||||
path: str = "example/path",
|
||||
method: str = "POST"
|
||||
):
|
||||
"""Demo get endpoints"""
|
||||
endpoint = next((e for e in endpoints if e["path"] == path), None)
|
||||
if not endpoint:
|
||||
raise HTTPException(status_code=400, detail="Endpoint not found")
|
||||
|
||||
return {
|
||||
"message": "Endpoint retrieved successfully",
|
||||
"path": path,
|
||||
"method": method,
|
||||
"features": {
|
||||
"rate_limit": 100,
|
||||
"expires_in": 3600
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user