Sometimes I only want to proxy with the POST request cause the GET request don't need proxy.
'/login': {
target: 'http://127.0.0.1:9090',
changeOrigin: true
}
I need a /login page to render the login form, so I just want to proxy the POST /login request. May be we can add a method option:
'/login': {
target: 'http://127.0.0.1:9090',
changeOrigin: true,
method: 'POST'
}
or we can handle the express next function of option.onProxyReq:
'/login': {
target: 'http://127.0.0.1:9090',
changeOrigin: true,
onProxyReq: (proxyReq, req, res, next) => {
if (req.method === 'GET') next()
}
}
Sometimes I only want to proxy with the
POSTrequest cause theGETrequest don't need proxy.I need a
/loginpage to render the login form, so I just want to proxy thePOST/loginrequest. May be we can add a method option:or we can handle the express
nextfunction ofoption.onProxyReq: