🩹 frontend: fixing proxy in development to backend for /plugins/
This commit is contained in:
committed by
ericlinagora
parent
5f4595338a
commit
5e1ac7b010
@@ -1,8 +1,12 @@
|
|||||||
const { createProxyMiddleware } = require('http-proxy-middleware');
|
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||||
|
|
||||||
module.exports = function (app) {
|
module.exports = function (app) {
|
||||||
app.use(
|
[
|
||||||
'/internal',
|
'/internal',
|
||||||
|
'/plugins',
|
||||||
|
].forEach(urlPrefix => {
|
||||||
|
app.use(
|
||||||
|
urlPrefix,
|
||||||
createProxyMiddleware({
|
createProxyMiddleware({
|
||||||
target: 'http://127.0.0.1:4000',
|
target: 'http://127.0.0.1:4000',
|
||||||
onError: (err, req, resp) => {
|
onError: (err, req, resp) => {
|
||||||
@@ -10,10 +14,5 @@ module.exports = function (app) {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
app.use(
|
});
|
||||||
'/__',
|
|
||||||
createProxyMiddleware({
|
|
||||||
target: 'http://127.0.0.1:4000',
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user