mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-17 21:00:45 +00:00
Update to take port optionally from process.env.REACT_APP_PROXY_LOCALHOST_PORT; more explict mapping of all paths that javalin backend exposes
This commit is contained in:
@ -29,19 +29,27 @@ const {createProxyMiddleware} = require("http-proxy-middleware");
|
||||
|
||||
module.exports = function (app)
|
||||
{
|
||||
app.use(
|
||||
"/data/*/export/*",
|
||||
createProxyMiddleware({
|
||||
target: "http://localhost:8000",
|
||||
changeOrigin: true,
|
||||
}),
|
||||
);
|
||||
let port = 8000;
|
||||
if(process.env.REACT_APP_PROXY_LOCALHOST_PORT)
|
||||
{
|
||||
port = process.env.REACT_APP_PROXY_LOCALHOST_PORT;
|
||||
}
|
||||
|
||||
app.use(
|
||||
"/download/*",
|
||||
createProxyMiddleware({
|
||||
target: "http://localhost:8000",
|
||||
function getRequestHandler()
|
||||
{
|
||||
return createProxyMiddleware({
|
||||
target: `http://localhost:${port}`,
|
||||
changeOrigin: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
app.use("/data/*/export/*", getRequestHandler());
|
||||
app.use("/download/*", getRequestHandler());
|
||||
app.use("/metaData/*", getRequestHandler());
|
||||
app.use("/data/*", getRequestHandler());
|
||||
app.use("/widget/*", getRequestHandler());
|
||||
app.use("/serverInfo", getRequestHandler());
|
||||
app.use("/processes", getRequestHandler());
|
||||
app.use("/reports", getRequestHandler());
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user