Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -35,6 +35,17 @@ logger = logging.getLogger(__name__)
|
|
| 35 |
|
| 36 |
app = FastAPI()
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
# Apply rate limiting middleware
|
| 39 |
app.state.limiter = limiter
|
| 40 |
app.add_middleware(SlowAPIMiddleware)
|
|
|
|
| 35 |
|
| 36 |
app = FastAPI()
|
| 37 |
|
| 38 |
+
|
| 39 |
+
# Serve static files (frontend)
|
| 40 |
+
app.mount("/static", StaticFiles(directory="static"), name="static")
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
@app.get("/", response_class=HTMLResponse)
|
| 44 |
+
def home ():
|
| 45 |
+
with open("static/indexAI.html","r") as file :
|
| 46 |
+
return file.read()
|
| 47 |
+
|
| 48 |
+
|
| 49 |
# Apply rate limiting middleware
|
| 50 |
app.state.limiter = limiter
|
| 51 |
app.add_middleware(SlowAPIMiddleware)
|