Reputation: 331
I have the following APIs, in order
router.post('/:name/insertDesign', function(req, res) {
console.log('[API] /insertDesign { username: ' + req.params.name + ' }');
router.get('/:name/:project', excludeSpecialRoutes, function(req, res, next) {
result = {
username: 'anonymous',
project: req.params.project,
access: 'Public',
};
console.log('[API] /project', result);
When running the post call in localhost I got the following log:
[API] /insertDesign { username: vc }
but when running it post call in the live server the log is as follow:
[API] /project { username: 'anonymous',
project: 'insertDesign',
access: 'Public' }
This is very confusing, shouldn't the API call reached the code in order? The code was working fine in the live server before.. Kindly give advice how I could troubleshoot this issue.. Thank you.
Upvotes: 1
Views: 335
Reputation: 123
Maybe it's your nginx if it's on the server. POST request turns into GET request
I assumed you tried on your local machine without nginx while the server has one.
Upvotes: 1
Reputation: 11
seems like in the live server you made a get request, not post.
Upvotes: 1