From 5b08275dfe3d7018208cd7d0771cfcdafb033d88 Mon Sep 17 00:00:00 2001 From: wearrrrr Date: Sun, 11 Feb 2024 20:14:37 -0600 Subject: [PATCH] add dotenv variable for rammerhead URL constructor --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d2ae44e..401f739 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,7 @@ dotenv.config(); if (!existsSync("./dist")) build(); const PORT = process.env.PORT || 3000; +const SITE_URL = process.env.URL || "http://0.0.0.0"; const bare = createBareServer("/bare/"); console.log(chalk.gray("Starting Bare...")); @@ -43,7 +44,7 @@ const rammerheadSession = /^\/[a-z0-9]{32}/; const rh_path = "node_modules/rammerhead/src/client"; function shouldRouteRh(req) { - const url = new URL(req.url, "http://0.0.0.0"); + const url = new URL(req.url, SITE_URL); return rammerheadScopes.includes(url.pathname) || rammerheadSession.test(url.pathname); }