1

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.

cristie09
  • 311
  • 1
  • 3
  • 11

2 Answers2

1

seems like in the live server you made a get request, not post.

1

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.

Don F.
  • 123
  • 8
  • ok, i just checked that the real issue is in my nginx configuration - it converted post to get .. thanks a lot! – cristie09 Jul 22 '20 at 09:00