I recently began building an app with node.js. After some time I wanted to move it onto my hosting account to really test it.
First I installed nodejs from source. Then I changed nothing to the code except for Database login. When I ran it, there were no error. Excitedly I tried it out. To my dismay, I got a 404 for every single route I had programed.
For example:
router.route('/new')
.post(function(req, res){
//My Route Code
});
app.use('/api', router);
Then I go to:
mywebsite.com/api/new
This returns a 404 Not Found
Error from my apache server.
I would also like to note that I am using I am using Shared Hosting, and I have also thoroughly tested my code offline on my test server.
How can I fix it so that my code actually routes my request?