Created
November 12, 2019 15:35
-
-
Save terrysahaidak/3fa557ced00530315218050af6febc39 to your computer and use it in GitHub Desktop.
CRA Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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