File size: 485 Bytes
b6dcc89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from fastapi import APIRouter

# Create the router for help/info endpoints
router = APIRouter(
    prefix="/help",
    tags=["Information"] 
)

@router.get("/")
def get_api_info():
    """
    Returns general information about the API and available endpoints.
    """
    return {
        "api_name": "My Awesome FastAPI",
        "version": "1.0",
        "available_sections": ["/random", "/help"],
        "message": "Use the /docs endpoint for interactive API documentation."
    }