Proxy not working with preflight OPTIONS request of the browser. It will run into a timeout with BadRequestError: request aborted.
It is working as intended if I initiate directly a POST request with e.g. "Postman".
app.use(cors());
app.use(bodyParser.json());
app.use(
'/xyz',
proxy({
target: 'http://localhost:8082',
changeOrigin: true,
})
);
Any ideas or possible solution to this problem?
Looks like it is related to the bodyParser.... Moved the proxy on top and it works.
Most helpful comment
Looks like it is related to the
bodyParser.... Moved the proxy on top and it works.