Uptime is a Node.js application that monitors an API endpoint and sends a notification to a Telegram bot when the API responds with a 200 OK status. This tool is ideal for tracking movie ticket availability or similar use cases where timely updates are crucial.
- Continuously monitors a specified API endpoint every 5 seconds.
- Sends a Telegram notification when the API status is 200 OK.
- Simple configuration for API endpoint and Telegram bot settings.
- Node.js (version 14.x or later recommended)
dotenvlibrary for environment variablesnode-fetchlibrary for HTTP requests
Create a .env file in the root of the project directory and add the following environment variables:
API_ENDPOINT=https://localhost:3001/
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
CHAT_ID=your_telegram_chat_idReplace
API_ENDPOINTwith the URL of the API endpoint you want to monitor. UpdateTELEGRAM_BOT_TOKENandCHAT_IDwith your Telegram bot token and chat ID, respectively.