Spaces:
Running
Running
| from fastapi import FastAPI | |
| from fastapi.staticfiles import StaticFiles | |
| from fastapi.templating import Jinja2Templates | |
| from fastapi.requests import Request | |
| from endpoints import router | |
| import uvicorn | |
| app = FastAPI() | |
| # Serve static files (CSS, JS) | |
| app.mount("/static", StaticFiles(directory="static"), name="static") | |
| # Serve HTML templates | |
| templates = Jinja2Templates(directory="templates") | |
| def home(request: Request): | |
| return templates.TemplateResponse("index.html", {"request": request}) | |
| # Include your API endpoints | |
| app.include_router(router) | |
| if __name__ == "__main__": | |
| uvicorn.run(app, host="127.0.0.1", port=8000) |