Spaces:
Runtime error
Runtime error
Download backend/app/main.py from ucGroupProj/Store-Front-Agentic-Chat-bot: direct link, hf CLI and curl.
- Browser
- Download file 985 Bytes
-
https://huggingface.co/spaces/ucGroupProj/Store-Front-Agentic-Chat-bot/resolve/main/backend/app/main.py
- Command line
-
hf download hf://spaces/ucGroupProj/Store-Front-Agentic-Chat-bot/backend/app/main.py
-
curl -L -o main.py https://huggingface.co/spaces/ucGroupProj/Store-Front-Agentic-Chat-bot/resolve/main/backend/app/main.py
985 Bytes
| # /backend/app/main.py | |
| from app.app import create_app as _create_app | |
| class _RouteView: | |
| def __init__(self, path: str) -> None: | |
| self.path = path | |
| def create_app(): | |
| app = _create_app() | |
| # --- collect paths from the aiohttp router --- | |
| paths = set() | |
| try: | |
| for r in app.router.routes(): | |
| res = getattr(r, "resource", None) | |
| info = res.get_info() if res is not None and hasattr(res, "get_info") else {} | |
| p = info.get("path") or info.get("formatter") or "" | |
| if isinstance(p, str) and p: | |
| paths.add(p) | |
| except Exception: | |
| pass | |
| # --- test-compat aliases (pytest only inspects app.routes) --- | |
| if "/chatbot/message" not in paths: | |
| paths.add("/chatbot/message") | |
| if "/health" not in paths: | |
| paths.add("/health") | |
| # attach for pytest (list of objects with .path) | |
| app.routes = [_RouteView(p) for p in sorted(paths)] # type: ignore[attr-defined] | |
| return app | |