This repository has been archived on 2024-08-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
khufu/server/index.js

10 lines
531 B
JavaScript

const express = require("express");
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", proxy({ target: cairoUrl, changeOrigin: true }));
app.use("/nubian", proxy({ target: nubianUrl, changeOrigin: true }));
app.listen(port, () => console.log(`🌴 Nile server started on ${port}! 🌴`));