I am facing a very strange issue. I have two routes configured. one for my dashboard and one for external API.
dashboard = require('./routes/dashboard')(passport);
api = require('./routes/api');
app.use('/', dashboard);
app.use('/api', api);
The following two routes are defined in my api.js routes file.
router.post('/somepostlink',function(){
// this is reachable from request query.
})
router.get('/somegetlink',function(){
// this is NOT reachable from request query.
})
I have this defined in my dashboard.js routes files :
// If no route is matched, control is transferred to the block of code below
router.get('*',function (request,response) {
console.log("Route not found");
return response.send("OOPs :( \nSeems like the page you are looking
for, isn't available with us.").status(404);
Now, POST request to localhost:3000/api/somepostlink works. But, GET request to localhost:3000/api/somegetlink shows
"OOPs :( \nSeems like the page you are looking for, isn't available with us."