Rewrite for /api routes not succesful on post requests
See original GitHub issueDescribe 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
- OS/Environment: Deployed in AWS, no errors in build and deploy
- @sls-next/serverless-component version: 1.19.0-alpha-22
- Next.js version: 10.0.2
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
oralpha
@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 oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, you are right, I thought I tested it and it worked but let me fix that, thanks!
Hey, just deployed it now and all looks good, thanks for this, utterly amazing ❤️