-
Notifications
You must be signed in to change notification settings - Fork 878
Closed
Description
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()
}
}
lerit and dasaco
Metadata
Metadata
Assignees
Labels
No labels