need help with hosting a simple website
hi, i am new to hosting projects, i just hosted a simple node + express application on netlify and i seem to be having issues.
in my node server.js file i have this
app.get("/course/:id", (req, res) => {
but when i go to "mynetlifyurl/course/1" i get the netlify page not found error
i tried askign gpt and bard for the solution but they aren't helpful
5 Replies
here is the complete endpoint
How to Deploy an Express.js Application to Vercel
Learn how to deploy an Express.js application to Vercel using Serverless Functions.
Basically it's a pita 🥲 Vercel and Netlify are "serverless“ hosting which means you need to wrap things in serverless functions to use them on their platform.
Or find hosting for a nodejs server.
Yea that's what I ended up doing, using render instead of netlify
Hey GSUS,
I'm not the node expert, but Netlify hosts static sites by default; your code is written to have a node server backend.
You'll likely need Netlify Functions in addition to your repository to proceed:
https://docs.netlify.com/functions/overview/
--> That way, the express api that's using app.get() can actively listen.
--> Otherwise, you'd just add a html page in the project folder ./course/id to navigate.