mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
27 lines
516 B
JavaScript
27 lines
516 B
JavaScript
|
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||
|
|
||
|
const API_URL = process.env.UNLEASH_API || 'http://localhost:4242';
|
||
|
|
||
|
module.exports = function(app) {
|
||
|
app.use(
|
||
|
'/api',
|
||
|
createProxyMiddleware({
|
||
|
target: API_URL,
|
||
|
changeOrigin: true,
|
||
|
}),
|
||
|
);
|
||
|
app.use(
|
||
|
'/auth',
|
||
|
createProxyMiddleware({
|
||
|
target: API_URL,
|
||
|
changeOrigin: true,
|
||
|
}),
|
||
|
);
|
||
|
app.use(
|
||
|
'/logout',
|
||
|
createProxyMiddleware({
|
||
|
target: API_URL,
|
||
|
changeOrigin: true,
|
||
|
}),
|
||
|
);
|
||
|
};
|