fix: fixed the reqest error while loading / route
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from slowapi.util import get_remote_address
|
|
| 6 |
from fastapi.responses import JSONResponse
|
| 7 |
from features.text_classifier.routes import router as text_classifier_router
|
| 8 |
from config import ACCESS_RATE
|
| 9 |
-
|
| 10 |
limiter = Limiter(key_func=get_remote_address, default_limits=[ACCESS_RATE])
|
| 11 |
|
| 12 |
app = FastAPI()
|
|
@@ -28,7 +28,7 @@ app.include_router(text_classifier_router, prefix="/text")
|
|
| 28 |
|
| 29 |
@app.get("/")
|
| 30 |
@limiter.limit(ACCESS_RATE)
|
| 31 |
-
async def root():
|
| 32 |
return {
|
| 33 |
"message": "API is working",
|
| 34 |
"endpoints": ["/text/analyse", "/text/upload", "/text/analyse-sentences", "/text/analyse-sentance-file"]
|
|
|
|
| 6 |
from fastapi.responses import JSONResponse
|
| 7 |
from features.text_classifier.routes import router as text_classifier_router
|
| 8 |
from config import ACCESS_RATE
|
| 9 |
+
import requests
|
| 10 |
limiter = Limiter(key_func=get_remote_address, default_limits=[ACCESS_RATE])
|
| 11 |
|
| 12 |
app = FastAPI()
|
|
|
|
| 28 |
|
| 29 |
@app.get("/")
|
| 30 |
@limiter.limit(ACCESS_RATE)
|
| 31 |
+
async def root(request: Request):
|
| 32 |
return {
|
| 33 |
"message": "API is working",
|
| 34 |
"endpoints": ["/text/analyse", "/text/upload", "/text/analyse-sentences", "/text/analyse-sentance-file"]
|