I have an issue with a simple app nodeJS and jQuery app I have deployed to Heroku. I am using a post request which functions on my localhost but when deployed to heroku returns the following error:
Cannot GET /api/friends
This request is made via a front end html form:
'<a href="/api/friends" method='post'><button type="button" class="btn
btn-success" id="submit">Submit</button></a>'
on the server it is processed with this:
app.post('/api/friends', function(req, res) {
var user = new User(req.body.name, req.body.species, req.body.scores);
user.match();
res.json(user.bestie);
});
Any ideas why this might be giving me the above error message in Heroku? I have looked through stackoverflow and can only seem to find similar issues in PHP.
Thanks Mike