Skip to content

Instantly share code, notes, and snippets.

@rsyuzyov
Last active February 11, 2024 17:35
Show Gist options
  • Save rsyuzyov/f6be15bb3945a70a0414bac14c883476 to your computer and use it in GitHub Desktop.
Save rsyuzyov/f6be15bb3945a70a0414bac14c883476 to your computer and use it in GitHub Desktop.
setupProxy.js
const { createProxyMiddleware } = require('http-proxy-middleware')
module.exports = function (app) {
app.use(
'/api',
createProxyMiddleware({
target: 'http://host:port',
pathRewrite: {
'^/api': '/ibname/hs/servicename'
},
changeOrigin: true,
})
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment