I have this in jQuery :
$.ajax(
{
type: 'POST',
data : mydata,
url : '/routerfunction',
dataType : 'String',
success : function(data)
{
//do stuff
},
error: function(xhr, status, error)
{
console.log(error);
console.log(xhr);
console.log(status);
},
}
And I have this in index.js(node)
router.post('/routerfunction/:mydata', function(req,res)
{
//do stuff
}
And I have this in app.js(node)
app.use('/', index);
app.use('/users', users);
When I do a POST request to routerfunction, I get 404 error. I have really tried to find the bug but I couldn't.. Where could the bug be? Thanks in advance.