Spaces:
Running
Running
Update webhook URLs from Railway to Hugging Face
Browse filesFiles changed (2)
199 unmodified lines200201202203204205206207208199 unmodified linesif not bot_token:raise HTTPException(status_code=400, detail="No Telegram bot token configured")# Construct webhook URL (Railway domain)# User needs to provide their Railway domainwebhook_url = f"https://microfunnel-production.up.railway.app/api/v1/webhook/telegram/{tenant_id}"# Register webhook with ALL message typesasync with httpx.AsyncClient() as client:199 unmodified lines200201202203204205206207208199 unmodified linesif not bot_token:raise HTTPException(status_code=400, detail="No Telegram bot token configured")# Construct webhook URL from settingswebhook_base = (settings.TELEGRAM_WEBHOOK_URL or "https://axeronis-microfunnel-api.hf.space").rstrip("/")webhook_url = f"{webhook_base}/api/v1/webhook/telegram-notify/{tenant_id}"# Register webhook with ALL message typesasync with httpx.AsyncClient() as client:
42 unmodified lines434445464748496 unmodified lines5657585960616242 unmodified lines# CORS - Allowed Origins (comma-separated)# Development: http://localhost:3000# Production: https://your-app.vercel.app,https://your-domain.comALLOWED_ORIGINS: str = "http://localhost:3000,http://127.0.0.1:3000,https://microfunnel-platform-production.up.railway.app,https://microfunnelai.vercel.app"# Frontend URL (for webhooks and redirects)FRONTEND_URL: str = "https://microfunnel.online"6 unmodified lines# Platform-level bot for admin notifications (hot leads, orders, bookings)# Fallback when tenant doesn't have their own bot configuredTELEGRAM_NOTIFICATION_TOKEN: Optional[str] = NoneTELEGRAM_WEBHOOK_URL: Optional[str] = None# AI SettingsMAX_CONTEXT_MESSAGES: int = 50 # Increased from 30 to 50 for better conversation memory42 unmodified lines434445464748496 unmodified lines5657585960616242 unmodified lines# CORS - Allowed Origins (comma-separated)# Development: http://localhost:3000# Production: https://your-app.vercel.app,https://your-domain.comALLOWED_ORIGINS: str = "http://localhost:3000,http://127.0.0.1:3000,https://axeronis-microfunnel-api.hf.space,https://microfunnelai.vercel.app"# Frontend URL (for webhooks and redirects)FRONTEND_URL: str = "https://microfunnel.online"6 unmodified lines# Platform-level bot for admin notifications (hot leads, orders, bookings)# Fallback when tenant doesn't have their own bot configuredTELEGRAM_NOTIFICATION_TOKEN: Optional[str] = NoneTELEGRAM_WEBHOOK_URL: Optional[str] = "https://axeronis-microfunnel-api.hf.space"# AI SettingsMAX_CONTEXT_MESSAGES: int = 50 # Increased from 30 to 50 for better conversation memory
backend/app/api/telegram_webhook.py+3-3
backend/app/core/config.py+2-2