Problem with hosting authentication service
Hello,
i have a problem with hosting my nodejs express application (getting a 503). Frontend and backend is successfully running as excepted.
Link to auth server: https://auth.findnlink.com/
Service id: ffd2f9a6-afc0-4546-aa43-bc9b1935038a
const PORT = process.env.PORT || 3000;
const HOST = "0.0.0.0";
server.listen(PORT, HOST, () => {
console.log(
Findnlink Auth Server running on ${HOST}:${PORT});
app.emit("ready");
});
Thanks in advance20 Replies
Project ID:
ffd2f9a6-afc0-4546-aa43-bc9b1935038a
Log is printing: Findnlink Auth Server running on 0.0.0.0:3000
show me a screenshot of your service variables?
sure 1 sec
try removing the port, you don't need to specify your own, railway will auto generate a port for you
hm ok, because i had the same problem with the backend service and then i added my PORT and it worked. Ok removed it
yeah but it's best to just listen on the PORT railway wants you to then to specify your own
also just as a sanity check, this Auth service does communicate over http right?
no im using https
and still not working without port
same transport protocol
what does the logs say now?
yarn run v1.22.19
$ node server.js
[HPM] Proxy created: / -> https://backend.findnlink.com
[HPM] Proxy rewrite rule created: "^/proxy" ~> ""
MongoDB - Database connection established successfully.
Findnlink Auth Server running on 0.0.0.0:8078
that looks good
what type of Auth server is this? home grown?
yes i think so. Home grown means like that i've coded it myself?
and not using any prebuilt auth
and you are absolutely sure you are staring an http server and not a tcp server?
i think i found the problem:
const server = https.createServer({
key: fs.readFileSync("./certs/key.pem"),
cert: fs.readFileSync("./certs/cert.pem")
}, app);
this shouldn't work calling readFile..) will remove ityeah start http server, not https, railways handles https for you
ok will try my luck, ty π Will come back if something isn't working properly
sounds good
yey its working ty
awesome!!