I think it uses port 3000. But regardless if you use the below it should be fine. The code process.env.PORT means that whatever is in the environment variable PORT, on Vercel's end gets assigned as the port number. Otherwise it uses 3000 or whatever port number you put there.
Nope, I'm using plain windows, but I just can't get the app running on vercel for some reason, it's working perfectly well on localhost and even zeet.co (as you have an option to set a port to listen on) but can't figure out vercel
Do you have some github repo or anything which u can link which successfully deploys an express app to vercel
how to set the port in vercel for it to know which port to serve the app on
Hi I am not sure what you mean I think Vercel assigns a default port that can't be changed. However you can use whatever port you want locally.
What port does it assign by default, like what should I set here app.listen(8000, ()=> {
console.log("app started")
})
I think it uses port 3000. But regardless if you use the below it should be fine. The code
process.env.PORTmeans that whatever is in the environment variable PORT, on Vercel's end gets assigned as the port number. Otherwise it uses 3000 or whatever port number you put there.I tried it, but dosent work, just gives me a 404 page on vercel
Hmm is your operating system Linux? Linux is not well supported by Vercel when using this method.
Nope, I'm using plain windows, but I just can't get the app running on vercel for some reason, it's working perfectly well on localhost and even zeet.co (as you have an option to set a port to listen on) but can't figure out vercel
Do you have some github repo or anything which u can link which successfully deploys an express app to vercel
Here Vercel Node App
I checked it out and tried to recreate it but with my app, but still no success :(
here's the repo, if you can point out what mistake i am making : github.com/Krish-Nerkar/genzmafia....