ethiotech4848 commited on
Commit
3668129
·
verified ·
1 Parent(s): ba159f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -19,9 +19,8 @@ app.add_middleware(
19
  allow_headers=["*"],
20
  )
21
 
22
- # Create and include router
23
- router = APIRouter(prefix="/api" if os.getenv('HF_SPACE') else "")
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
- @router.post("/slack/command")
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(...),