I\'ve a problem when I try to do PATCH request in an angular 7 web application. In my backend I have:
app.use((re
use this in Node
app.use(function (req, res, next) {
//Enabling CORS
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type,
Accept, x-client-key, x-client-token, x-client-secret, Authorization");
next();
});
And in angular the request is
auth(login): Promise {
return new Promise((resolve, reject) => {
this._http.post('url:3000/api/auth/login', { ...login })
.subscribe((response: any) => {
resolve(response);
});
});
}