mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10: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)
|
module.exports = function (app)
|
||||||
{
|
{
|
||||||
app.use(
|
let port = 8000;
|
||||||
"/data/*/export/*",
|
if(process.env.REACT_APP_PROXY_LOCALHOST_PORT)
|
||||||
createProxyMiddleware({
|
{
|
||||||
target: "http://localhost:8000",
|
port = process.env.REACT_APP_PROXY_LOCALHOST_PORT;
|
||||||
changeOrigin: true,
|
}
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
app.use(
|
function getRequestHandler()
|
||||||
"/download/*",
|
{
|
||||||
createProxyMiddleware({
|
return createProxyMiddleware({
|
||||||
target: "http://localhost:8000",
|
target: `http://localhost:${port}`,
|
||||||
changeOrigin: true,
|
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