Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -459,26 +459,29 @@ app = FastAPI()
|
|
| 459 |
@app.get("/")
|
| 460 |
def root(): # ② health‑check hits this → must return 200 quickly
|
| 461 |
# return {"status": "ok"}
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
<
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
</
|
| 479 |
-
</
|
| 480 |
-
"""
|
| 481 |
-
|
|
|
|
|
|
|
|
|
|
| 482 |
|
| 483 |
@app.on_event("startup")
|
| 484 |
def startup():
|
|
|
|
| 459 |
@app.get("/")
|
| 460 |
def root(): # ② health‑check hits this → must return 200 quickly
|
| 461 |
# return {"status": "ok"}
|
| 462 |
+
return RedirectResponse(
|
| 463 |
+
url="https://t.me/python3463_bot",
|
| 464 |
+
status_code=status.HTTP_302_FOUND # 302 is fine too
|
| 465 |
+
)
|
| 466 |
+
# html_content = """
|
| 467 |
+
# <!DOCTYPE html>
|
| 468 |
+
# <html>
|
| 469 |
+
# <head>
|
| 470 |
+
# <title>Telegram Bot Preview</title>
|
| 471 |
+
# <meta property="og:title" content="Join the Python Bot" />
|
| 472 |
+
# <meta property="og:description" content="Click to chat with the Python Bot on Telegram." />
|
| 473 |
+
# <meta property="og:url" content="https://t.me/python3463_bot" />
|
| 474 |
+
# <meta property="og:type" content="website" />
|
| 475 |
+
# <meta property="og:image" content="https://telegram.org/img/t_logo.png" />
|
| 476 |
+
# </head>
|
| 477 |
+
# <body>
|
| 478 |
+
# <h1>Open Telegram Bot</h1>
|
| 479 |
+
# <p><a href="https://t.me/python3463_bot" target="_blank">Click here to open the bot</a></p>
|
| 480 |
+
# <iframe src="https://t.me/python3463_bot" width="100%" height="500px" style="border:none;"></iframe>
|
| 481 |
+
# </body>
|
| 482 |
+
# </html>
|
| 483 |
+
# """
|
| 484 |
+
# return HTMLResponse(content=html_content)
|
| 485 |
|
| 486 |
@app.on_event("startup")
|
| 487 |
def startup():
|