I have a Restful API implemented in NodeJS running normally locally, with all the routes responding, all right. However, when putting into production on the KingHost server only the root route works.
I made a basic application for testing alternative routes and it also did not work.
Follow the code below:
var express = require('express');
var app = express();
app.all("*", (req, res, next) => {
console.log('Time:', Date.now());
next();
});
app.get("/", (req, res) => res.send("ROOT"));
app.get("/novo", (req, res) => res.send("NOVO"));
app.listen(process.env.PORT || 21265, () => console.log("Server is running!"));
Has anyone ever had a similar problem or am I forgetting something?
EDIT: I got in touch through a call with the KingHost team and they replied that this type of service only works when adding the port in the URL. Unfortunately there is no other alternative ¬¬