R
Railwayβ€’2y ago
jaemil

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 advance
20 Replies
Percy
Percyβ€’2y ago
Project ID: ffd2f9a6-afc0-4546-aa43-bc9b1935038a
jaemil
jaemilOPβ€’2y ago
Log is printing: Findnlink Auth Server running on 0.0.0.0:3000
Brody
Brodyβ€’2y ago
show me a screenshot of your service variables?
jaemil
jaemilOPβ€’2y ago
sure 1 sec
jaemil
jaemilOPβ€’2y ago
Brody
Brodyβ€’2y ago
try removing the port, you don't need to specify your own, railway will auto generate a port for you
jaemil
jaemilOPβ€’2y ago
hm ok, because i had the same problem with the backend service and then i added my PORT and it worked. Ok removed it
Brody
Brodyβ€’2y ago
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?
jaemil
jaemilOPβ€’2y ago
no im using https and still not working without port
Brody
Brodyβ€’2y ago
same transport protocol what does the logs say now?
jaemil
jaemilOPβ€’2y ago
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
Brody
Brodyβ€’2y ago
that looks good what type of Auth server is this? home grown?
jaemil
jaemilOPβ€’2y ago
yes i think so. Home grown means like that i've coded it myself? and not using any prebuilt auth
Brody
Brodyβ€’2y ago
and you are absolutely sure you are staring an http server and not a tcp server?
jaemil
jaemilOPβ€’2y ago
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 it
Brody
Brodyβ€’2y ago
yeah start http server, not https, railways handles https for you
jaemil
jaemilOPβ€’2y ago
ok will try my luck, ty πŸ™‚ Will come back if something isn't working properly
Brody
Brodyβ€’2y ago
sounds good
jaemil
jaemilOPβ€’2y ago
yey its working ty
Brody
Brodyβ€’2y ago
awesome!!
Want results from more Discord servers?
Add your server