Spaces:
Running
Running
Commit ·
d896c38
1
Parent(s): 86a56f9
fix(api): add root endpoint redirect to prevent HF Space UI 404s
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import re
|
|
| 3 |
import logging
|
| 4 |
from typing import List, Dict, Any, Optional
|
| 5 |
from fastapi import FastAPI
|
|
|
|
| 6 |
from pydantic import BaseModel
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
|
|
@@ -30,6 +31,10 @@ class TickRequest(BaseModel):
|
|
| 30 |
|
| 31 |
contexts = {"category": {}, "merchant": {}, "customer": {}, "trigger": {}}
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
@app.get("/v1/healthz")
|
| 34 |
async def healthz():
|
| 35 |
global contexts
|
|
|
|
| 3 |
import logging
|
| 4 |
from typing import List, Dict, Any, Optional
|
| 5 |
from fastapi import FastAPI
|
| 6 |
+
from fastapi.responses import RedirectResponse
|
| 7 |
from pydantic import BaseModel
|
| 8 |
from dotenv import load_dotenv
|
| 9 |
|
|
|
|
| 31 |
|
| 32 |
contexts = {"category": {}, "merchant": {}, "customer": {}, "trigger": {}}
|
| 33 |
|
| 34 |
+
@app.get("/")
|
| 35 |
+
async def root():
|
| 36 |
+
return RedirectResponse(url="/docs")
|
| 37 |
+
|
| 38 |
@app.get("/v1/healthz")
|
| 39 |
async def healthz():
|
| 40 |
global contexts
|