Answer the question
In order to leave comments, you need to log in
Node.js Express app not working on Ubuntu Server host, how to fix?
I can not connect to the express server either through an external IP or through an internal one. Forwarding on the router is configured.
const sendToChat = (message, resp) => {
console.log('Got Message')
if (chatID != null) {
bot.sendMessage(chatID, message);
resp.send('OK');
} else {
resp.send('CHAT_ID_IS_NOT_CONFIGURED');
}
}
app.get('/message', (req, res) => {
sendToChat(req.query.msg, res);
});
app.listen(3000, "0.0.0.0", () => {
//..
})
Answer the question
In order to leave comments, you need to log in
Since everything worked before installing Nginx, this is probably the problem. Perhaps after installing it by default, Nginx is accessed by IP. Try temporarily disabling Nginx on the host, or if it is indeed accessed first, set up proxying from Nginx to Node
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question