SHA-256: f1e14b9acacef616428b12962ceae8b4179c8bb1c390ee436173dd897484b757 (checksum file)
Stack: Node.js 20+, no dependencies · License: MIT · Files: 10
What it includes
Minimal HTTP webhook with secret-token check, /healthz, fast 200 and async sendMessage.
File tree
express-webhook/
├── src/
│ ├── logic.js
│ └── server.js
├── tests/
│ └── logic.test.js
├── .dockerignore
├── .env.example
├── .gitignore
├── Dockerfile
├── LICENSE
├── package.json
└── README.md
Setup
unzip express-webhook.zip && cd express-webhook
cp .env.example .env
npm test
npm run dev
Fill in .env with credentials from the platform's official developer console. Never commit it: the included .gitignore excludes it.
Step-by-step guide
- Download the ZIP above, check its SHA-256 and unzip it.
- Open @BotFather in Telegram, send /newbot and copy the token into BOT_TOKEN. Generate a random WEBHOOK_SECRET (for example openssl rand -hex 32).
- Copy
.env.exampleto.env(or.dev.varsfor Workers) and paste the values. Never commit it. - Install dependencies and run the tests: they pass without network access.
- Run it locally with the commands in the Setup section and send your bot a message.
- Push the folder to a private GitHub repository so a host can build it.
Deploy on Railway
- Press Deploy on Railway below and sign in (it opens a new Railway project).
- Choose Deploy from GitHub repo and pick your repository. Railway detects the included
Dockerfile. - Open Variables and add:
BOT_TOKEN, WEBHOOK_SECRET, PORT=8080. - In Settings → Networking generate a public domain so the platform can reach your webhook at
https://<domain>/telegram. - Watch the deploy logs until the bot reports it is running, then test it. Set a usage limit in your Railway workspace settings.
Affiliate link (referral code 8Mexkc): BotNetwork may earn a commission at no extra cost to you. The button opens Railway's new-project page; this template is not a published one-click Railway template, so you connect your own repository. Railway bills by usage: check its pricing page.
Next steps
- Related tutorial or comparison
- Tool: telegram url builder
- Tool: healthcheck builder
- Tool: nginx webhook
- Railway vs Vultr
Run with Docker
docker build -t express-webhook .
docker run --rm --env-file .env express-webhook