Centralize URL flow
This commit is contained in:
parent
5ebdbef674
commit
082f80ec9d
3 changed files with 10 additions and 5 deletions
|
@ -49,5 +49,10 @@
|
||||||
"last 1 firefox version",
|
"last 1 firefox version",
|
||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"nodemonConfig": {
|
||||||
|
"env": {
|
||||||
|
"CAIRO_URL": "http://localhost:52000"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const { createProxyMiddleware } = require("http-proxy-middleware");
|
const { createProxyMiddleware } = require("http-proxy-middleware");
|
||||||
const port = process.env.PORT || 52026;
|
const port = process.env.PORT ?? 52026;
|
||||||
const cairoUrl = process.env.CAIRO_URL || "http://cairo.dunestorm.net:52000";
|
const cairoUrl = process.env.CAIRO_URL ?? "http://cairo.dunestorm.net:52000";
|
||||||
const nubianUrl = process.env.NUBIAN_URL || "http://nubian.dunestorm.net:52001";
|
const nubianUrl = process.env.NUBIAN_URL ?? "http://nubian.dunestorm.net:52001";
|
||||||
const app = express();
|
const app = express();
|
||||||
app.use("/", express.static("build"));
|
app.use("/", express.static("build"));
|
||||||
app.use("/cairo", createProxyMiddleware({ target: cairoUrl }));
|
app.use("/cairo", createProxyMiddleware({ target: cairoUrl }));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const { createProxyMiddleware } = require("http-proxy-middleware");
|
const { createProxyMiddleware } = require("http-proxy-middleware");
|
||||||
const cairoUrl = process.env.CAIRO_URL || "http://cairo.dunestorm.net:52000";
|
const cairoUrl = process.env.CAIRO_URL ?? "http://cairo.dunestorm.net:52000";
|
||||||
const nubianUrl = process.env.NUBIAN_URL || "http://nubian.dunestorm.net:52001";
|
const nubianUrl = process.env.NUBIAN_URL ?? "http://nubian.dunestorm.net:52001";
|
||||||
module.exports = (app) => {
|
module.exports = (app) => {
|
||||||
// Cairo Proxy
|
// Cairo Proxy
|
||||||
app.use("/cairo", createProxyMiddleware({ target: cairoUrl }));
|
app.use("/cairo", createProxyMiddleware({ target: cairoUrl }));
|
||||||
|
|
Reference in a new issue