edit
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import httpx
|
|
6 |
|
7 |
app = FastAPI()
|
8 |
|
9 |
-
# Configurar CORS
|
10 |
app.add_middleware(
|
11 |
CORSMiddleware,
|
12 |
allow_origins=["*"],
|
@@ -31,7 +31,7 @@ async def startup_event():
|
|
31 |
async def send_telegram_message(message):
|
32 |
url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
|
33 |
params = {
|
34 |
-
"chat_id": TELEGRAM_CHAT_ID
|
35 |
"text": message
|
36 |
}
|
37 |
async with httpx.AsyncClient() as client:
|
|
|
6 |
|
7 |
app = FastAPI()
|
8 |
|
9 |
+
# Configurar CORS (Cross Origin Sources para leer desde otro dominio)
|
10 |
app.add_middleware(
|
11 |
CORSMiddleware,
|
12 |
allow_origins=["*"],
|
|
|
31 |
async def send_telegram_message(message):
|
32 |
url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
|
33 |
params = {
|
34 |
+
"chat_id": TELEGRAM_CHAT_ID,
|
35 |
"text": message
|
36 |
}
|
37 |
async with httpx.AsyncClient() as client:
|