question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rewrite for /api routes not succesful on post requests

See original GitHub issue

Describe the bug

Off the back of #832 being merged I went to deploy my next app using the latest alpha version 1.19.0-alpha-22.

As part of my config I rewrite /api/graphql to be https://api.example.com/v1/graphql, but all requests to this url fail

Actual behavior

I get a 404 from /api/graphql

Expected behavior

My POST request to resolve

Steps to reproduce

Versions

Additional context

I found this same problem on the old rewritten site aswell as our new next site that is proxied through. We see the same 404 on POST requests to our PHP API on /api/auth/login, I suspect POST is just broken on the rewrite functionality?

Checklist

  • You have reviewed the README and FAQs, which answers several common questions.
  • Please first try using the most recent latest or alpha @sls-next/serverless-component release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

3reactions
dphangcommented, Jan 6, 2021

Ah, you are right, I thought I tested it and it worked but let me fix that, thanks!

1reaction
benjaminkay93commented, Jan 7, 2021

Hey, just deployed it now and all looks good, thanks for this, utterly amazing ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot config or rewrite routing in ASP.NET MVC Web Api
I want to make exclude keyword in that url. I will have another route for that action as well. This is not working...
Read more >
Working with routes for HTTP APIs - Amazon API Gateway
Routes direct incoming API requests to backend resources. Routes consist of two parts: an HTTP method and a resource path—for example, GET /pets...
Read more >
Reverse Proxy with URL Rewrite v2 and Application Request ...
This walkthrough will guide you through how to use URL Rewrite Module and Application Request Routing (ARR) to implement a reverse proxy ...
Read more >
API Reference - Express 4.x
Routes HTTP DELETE requests to the specified path with the specified callback functions. For more information, see the routing guide.
Read more >
intercept - Cypress Documentation
method (String). Match the route to a specific HTTP method ( GET , POST , PUT , etc). If no method is defined...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found