Spaces:
Runtime error
Runtime error
Download app/api/cities.py from devmurtaza/RastaAI: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/devmurtaza/RastaAI/resolve/main/app/api/cities.py
- Command line
-
hf download hf://spaces/devmurtaza/RastaAI/app/api/cities.py
-
curl -L -o cities.py https://huggingface.co/spaces/devmurtaza/RastaAI/resolve/main/app/api/cities.py
400 Bytes
| """City search/list endpoint - convenience for the mobile app.""" | |
| from fastapi import APIRouter, Query | |
| from typing import List | |
| from app.services.locations import CITIES, search_cities | |
| router = APIRouter(tags=["cities"]) | |
| async def list_cities(q: str = Query("", description="Optional search query")) -> List[dict]: | |
| if q: | |
| return search_cities(q) | |
| return CITIES | |