🩹 frontend: fixing proxy in development to backend for /plugins/

This commit is contained in:
Eric Doughty-Papassideris
2024-06-13 14:52:38 +02:00
committed by ericlinagora
parent 5f4595338a
commit 5e1ac7b010
+6 -7
View File
@@ -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',
}),
);
}; };