#express

3 messages · Page 1 of 1 (latest)

high parcel
#

this code is working fine on my local machine but not working on railway why ?

require("dotenv").config();
const bodyParser = require("body-parser");
const TelegramBot = require("node-telegram-bot-api");
const token = process.env.TELEGRAM_TOKEN;
const bot = new TelegramBot(token, { polling: false });
const express = require("express");
const app = express();
app.use(bodyParser.json());
app.post("/alert", function (req, res) {
const { action, value, name } = req.body;
bot.sendMessage(
process.env.TELEGRAM_CHAT_ID,
Alert: \nname :- ${name}\naction :- ${action}\nvalue :- ${value}
);
res.send(req.body);
});

app.get("/", function (req, res) {
res.send("Hello World");
});

app.listen(80);

console.log("Server running at http://localhost:80/");

deep minnowBOT
#

Project ID: N/A

high parcel
#

N/A