#Need help with my deployment
177 messages · Page 1 of 1 (latest)
Project ID: 21580c19-45ac-4273-8aa3-11a0fdf0c9c1
21580c19-45ac-4273-8aa3-11a0fdf0c9c1
it's a rest api
3000
did u set that in the env var settings
if no, then railway wont be able to figure out what port to show to u
so u need to set it in the env var settings
alternatively
ur code can depend on he value of PORT env var
I did set PORT = process.env.PORT || 3000 isnt that enough
I mean i did that with all my previous projects
I just did that wait lemme show you
can i share app.js code with you I mean if you can point out the bug i tried but I could not figure it out
You using a dockerfile?
nope
Huh wierd. What did you set the env var port to?
like the PORT var?
Yea the environment variable in the ss above
3000
i feel like that should be fine. Are you able to share the part of your code that starts the server?
Does connected to db get logged?
wait shouldnt it be 0.0.0.0:3000?
no?
set the env var port to 0.0.0.0:3000 and se if that works
wait actually railway might not like that
i would try app.listen("0.0.0.0:3000" , () => orapp.listen(3000, "0.0.0.0" , () =>
wouldn't it be a problem? cuz im deploying it so that ppl can see and interact with it, setting port var like that will make my app non reachable to others tho
wouldn't it be a problem? try it and find out
yea cus its listening on localhost or 127.0.01
just try 0.0.0.0 and we will find out
i wish i knew ofthe top of my head but its been ages since ive written app.listen
loll
based
i do indeed think i was wrong
const port = process.env.PORT || 3333;
app.use(bodyParser.json());
app.use(bodyParser.raw({ type: "application/vnd.custom-type" }));
app.use(bodyParser.text({ type: "text/html" }));
app.get("/", async (req, res) => {
res.json({ Hello: "World" });
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});
should work
try it anyways maybe
wait fuckit ill try. 1 sec
kk
ah yes
hm? worked?
lol
chill bro its been 3 mins
LMFAO
confuzzled frfr
my little hands can only type so fast
👀
yup
do you know le awnser
ye
using templates is to smart for me
You don't need 127.0.0.1 or 0.0.0.0
Just listen on process.env.PORT
that's what i did tho
oh, you shared this here already
yee
could it be one of your middleware?
i allways am. dont worry its my natural state
Did you try redeploying?
idk tbh i think i did nothing wrong tho
or it seems
ye like more than 8 times
i did
nope
Do you have an index.js file?
ye for docs
set start command to node app.js in settings
i did lmfao
Oh
ye
Connected to DB!
Server is listening on port 3000...
like push it as if it's a new project?
yes
has the new one deployed?
it does but when i visit the link it says server error
on my github repo it says all checks have failed idk why
the same screen as before?
ye but i noticed that deploy logs are fat
when i check the other projects it just prints connected to db and server is listening
like this
i guess fix this error
netflix clone api == blog api?
you have deployed netflix clone api here
this is blog api
ye
blog api is already working
btw i just checked my github repo, it says 1 failing check in app.js
set your start command to ls
what do you see in logs?
Please copy paste this stuff ^
got it lmfao
what was the issue
i mispelled a file name (watchList instead of WatchList)
logs be helpful sometimes frfr
ahhh
thattle be a windows moment right there
yall go check it out and gimme your feedback
nice
why delete 👀
I thought you wanted your API's review lol
ye i did
docs look cool though
wdym
WYZ out here with the capybara macro
wdym by macro here lol?
I am using https://capy.lol
The next generation of capybara APIs, access over 700+ images of capybaras in high definition.
why is the example like 100 lines long
curl 'https://api.capy.lol/v1/capybara?json=true'
#1045027690270441573 💀
Try removing the environment variable "PORT" that you created in railway.app.
Railway should already have a "PORT" env variable set up when you deploy for your app to find.