From 9de76cdd4c288f2e326399567aff76f3d56466b0 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 21 Mar 2025 18:53:56 +0000 Subject: [PATCH] Update code in endpoints/new-endpoint.post.py --- endpoints/new-endpoint.post.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/endpoints/new-endpoint.post.py b/endpoints/new-endpoint.post.py index e69de29..04e9ea4 100644 --- a/endpoints/new-endpoint.post.py +++ b/endpoints/new-endpoint.post.py @@ -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 + } + } \ No newline at end of file