R
Railway•15mo ago
BIROALTACC

my api wont start on railway

i tried remvoing nodemon from my start script and I also tried in my start script using "node index.js" and only "index.js" nothing works project id: 9ca93930-ec44-4d40-81ae-5a2f6b7c6928
14 Replies
Percy
Percy•15mo ago
Project ID: 9ca93930-ec44-4d40-81ae-5a2f6b7c6928
Brody
Brody•15mo ago
you definitely need to have node prefixed to the start command node index.js are you building with a dockerfile or nixpacks?
BIROALTACC
BIROALTACC•15mo ago
first screenshot is with "node" prefix. Nixpacks any help with this?
Brody
Brody•15mo ago
not at the moment, I will circle around to this when I have the time
ThallesComH
ThallesComH•15mo ago
i had problems with the bcrypt library due to it's use of C++ bindings. you can consider using this: https://www.npmjs.com/package/bcryptjs. be aware that it's slower than the one you're using (about 30%) but everything else stays the same (even the API).
BIROALTACC
BIROALTACC•15mo ago
I just did this, uninstalled bcrypt and installed bcryptjs, unfortunately it didn't work, I still get this error
ThallesComH
ThallesComH•15mo ago
uhmm that wasn't supposed to happen as the bcryptjs is purely javascript. what error are you getting to be sure?
BIROALTACC
BIROALTACC•15mo ago
Oh, I messed up, forgot to change start script to node index.js after chaning my bcrypt to bcryptjs, it works now thanks!
Brody
Brody•15mo ago
thanks thalles! 🙂
BIROALTACC
BIROALTACC•15mo ago
Never ending errors with this deployment. Now my server is up and running, but I can't connect to it. Trying out my https://ecommerce-production.up.railway.app/api/auth/test test route to see if api is working and which should respond with "ok" but I get an error saying "Application failed to respond". So, my server is up and running yet its not? What am I missing out guys?
ThallesComH
ThallesComH•15mo ago
is your API listening on the correct port? railway auto inject a env variable called "PORT"
Brody
Brody•15mo ago
I've sent you this before, please read it this time https://docs.railway.app/troubleshoot/fixing-common-errors
BIROALTACC
BIROALTACC•15mo ago
I've found my solution, the problem was indeed in port. everything works now, thanks!
Brody
Brody•15mo ago
ABRD = always be reading documentation
Want results from more Discord servers?
Add your server