From 05302c3b044b4da736699ad4284bcc116c8f3f71 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Thu, 26 Sep 2024 19:09:48 -0400 Subject: [PATCH] fix 404 --- app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.js b/app.js index bc68afb..a34f7b8 100644 --- a/app.js +++ b/app.js @@ -289,6 +289,12 @@ app.get('/rss', (req, res) => { res.send(rssFeed); }); +// Create a URL object from the environment variable +const blog_URL = new URL(process.env.BLOG_URL); + +// Extract just the hostname (e.g., blog.raven-scott.fyi) +const hostname = blog_URL.hostname; + // Global 404 handler for unmatched routes app.use((req, res) => { if (req.hostname === hostname) {