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
2021-08-21 22:50:36 -06:00

10 lines
516 B
JavaScript

const express = require("express");
const { createProxyMiddleware } = 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.listen(port, () => console.log(`🌴 Nile server started on ${port}! 🌴`));