Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ class LoggingMiddleware(BaseHTTPMiddleware):
|
|
48 |
response = await call_next(request)
|
49 |
return response
|
50 |
|
51 |
-
|
52 |
|
53 |
# This should be a secure secret key in a real application
|
54 |
SECRET_KEY = "your_secret_key_here"
|
@@ -111,7 +111,7 @@ async def verify_token(token: str = Depends(api_key_query)):
|
|
111 |
raise HTTPException(status_code=401, detail={"message": "Token is invalid"})
|
112 |
return token
|
113 |
|
114 |
-
|
115 |
@app.post("/translate/", response_model=TranslationResponse)
|
116 |
async def translate(
|
117 |
request: Request,
|
|
|
48 |
response = await call_next(request)
|
49 |
return response
|
50 |
|
51 |
+
app.add_middleware(LoggingMiddleware)
|
52 |
|
53 |
# This should be a secure secret key in a real application
|
54 |
SECRET_KEY = "your_secret_key_here"
|
|
|
111 |
raise HTTPException(status_code=401, detail={"message": "Token is invalid"})
|
112 |
return token
|
113 |
|
114 |
+
@app.get("/translate/", response_model=TranslationResponse)
|
115 |
@app.post("/translate/", response_model=TranslationResponse)
|
116 |
async def translate(
|
117 |
request: Request,
|