Skip to content

Instantly share code, notes, and snippets.

@yohangz
Last active May 12, 2022 12:23
Show Gist options
  • Select an option

  • Save yohangz/f4f6d4ab7f6d5d648574c07c3925c454 to your computer and use it in GitHub Desktop.

Select an option

Save yohangz/f4f6d4ab7f6d5d648574c07c3925c454 to your computer and use it in GitHub Desktop.
Angular CLI proxy config
const PROXY_CONFIG = {
"**": {
"target": "http://localhost:9000",
"secure": false,
"bypass": function (req) {
if (req && req.headers && req.headers.accept && req.headers.accept.indexOf("html") !== -1) {
console.log("Skipping proxy for browser request.");
return "/index.html";
}
}
}
};
module.exports = PROXY_CONFIG;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment