Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,9 +19,8 @@ app.add_middleware(
|
|
| 19 |
allow_headers=["*"],
|
| 20 |
)
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
-
app.include_router(router)
|
| 25 |
|
| 26 |
# Root endpoint for health checks
|
| 27 |
@app.get("/")
|
|
@@ -283,7 +282,7 @@ def format_slack_message(conversation_data):
|
|
| 283 |
"blocks": blocks
|
| 284 |
}
|
| 285 |
|
| 286 |
-
@
|
| 287 |
async def slack_command(
|
| 288 |
token: str = Form(...),
|
| 289 |
command: str = Form(...),
|
|
|
|
| 19 |
allow_headers=["*"],
|
| 20 |
)
|
| 21 |
|
| 22 |
+
# Base path for Hugging Face Spaces
|
| 23 |
+
BASE_PATH = "/api" if os.getenv('HF_SPACE') else ""
|
|
|
|
| 24 |
|
| 25 |
# Root endpoint for health checks
|
| 26 |
@app.get("/")
|
|
|
|
| 282 |
"blocks": blocks
|
| 283 |
}
|
| 284 |
|
| 285 |
+
@app.post(f"{BASE_PATH}/slack/command")
|
| 286 |
async def slack_command(
|
| 287 |
token: str = Form(...),
|
| 288 |
command: str = Form(...),
|