Open christianscharr opened 6 years ago
@christianscharr you need usage proxy.conf.js for Angular
ng serve --proxy-config proxy.conf.js
const PROXY_CONFIG = {
"/api/proxy": {
"target": "http://localhost:3000",
"secure": false,
"bypass": function (req, res, proxyOptions) {
req.headers["X-Custom-Header"] = "yes";
}
}
}
module.exports = PROXY_CONFIG;
for historyApiFallback you can usage workaround
I am trying to enhance the default CLI configuration of webpack-dev-server. I need to set the following properties:
What I am seeing is. that ngw successfully injects this but it seems that @angular/cli overrides it afterwards... It never gets recognized by webpack-dev-server, whatever property I am setting inside "devServer"