Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrites - support for http methods other than get #21088

Closed
mvording opened this issue Jan 14, 2021 · 0 comments
Closed

rewrites - support for http methods other than get #21088

mvording opened this issue Jan 14, 2021 · 0 comments

Comments

@mvording
Copy link

mvording commented Jan 14, 2021

Describe the feature you'd like to request

It would be useful to be able to redirect all http methods using the Redirects feature (https://nextjs.org/docs/api-reference/next.config.js/redirects).

Usage:
/api/:path* requests sent to another server for all REST HTTP methods.

For server deployments this redirect is done by the ingress/load balancer, but for local development ideally next.js can redirect all requests to another application endpoint. This works fine for GET requests, but not for other HTTP methods.

Describe the solution you'd like

  async rewrites() {
    return [
      {
        source: '/api/:path*',
        destination: 'http://localhost:8080/api/:path*',
        methods: [ '*']  or [ 'GET','POST','PUT','DELETE'] 
      },
    ]
  }

Describe alternatives you've considered

.

@vercel vercel locked and limited conversation to collaborators Jan 15, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants