Skip to content

Instantly share code, notes, and snippets.

@terrysahaidak
Created November 12, 2019 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrysahaidak/3fa557ced00530315218050af6febc39 to your computer and use it in GitHub Desktop.
Save terrysahaidak/3fa557ced00530315218050af6febc39 to your computer and use it in GitHub Desktop.
CRA Proxy
const createProxy = require('http-proxy-middleware');
const proxy = createProxy({
target: 'https://apiko-marketplace-api-2019.herokuapp.com/',
pathRewrite: {
'^/api': '',
},
changeOrigin: true,
});
module.exports = (app) => {
app.use('/api', proxy);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment