Spaces:
Runtime error
Runtime error
Download main.py from Notionhive/visaverse-chatbot: direct link, hf CLI and curl.
- Browser
- Download file 544 Bytes
-
https://huggingface.co/spaces/Notionhive/visaverse-chatbot/resolve/main/main.py
- Command line
-
hf download hf://spaces/Notionhive/visaverse-chatbot/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Notionhive/visaverse-chatbot/resolve/main/main.py
544 Bytes
| #API Packages | |
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| #Route Calling From faq_routes.py | |
| from faq_routes import router as faq_router | |
| from ircc_updater import start_ircc_scheduler | |
| app = FastAPI() | |
| # Enable CORS for frontend | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Include FAQ API routes | |
| app.include_router(faq_router) | |
| async def startup_event(): | |
| start_ircc_scheduler() |