Added changeOrigin to the proxy
This commit is contained in:
parent
86c71e0e90
commit
ff2cf8a15b
1 changed files with 3 additions and 3 deletions
|
@ -1,10 +1,10 @@
|
|||
const express = require("express");
|
||||
const { createProxyMiddleware } = require("http-proxy-middleware");
|
||||
const { createProxyMiddleware: proxy } = require("http-proxy-middleware");
|
||||
const port = process.env.PORT ?? 52026;
|
||||
const cairoUrl = process.env.CAIRO_PUBLIC_URL;
|
||||
const nubianUrl = process.env.NUBIAN_INTERNAL_URL;
|
||||
const app = express();
|
||||
app.use("/", express.static("build"));
|
||||
app.use("/cairo", createProxyMiddleware({ target: cairoUrl }));
|
||||
app.use("/nubian", createProxyMiddleware({ target: nubianUrl }));
|
||||
app.use("/cairo", proxy({ target: cairoUrl, changeOrigin: true }));
|
||||
app.use("/nubian", proxy({ target: nubianUrl, changeOrigin: true }));
|
||||
app.listen(port, () => console.log(`🌴 Nile server started on ${port}! 🌴`));
|
||||
|
|
Reference in a new issue