From 0bb989ee6637ce49b2d7b4ba87909d8b8f2f4c8f Mon Sep 17 00:00:00 2001 From: localhost Date: Sun, 8 Oct 2023 09:48:05 +0200 Subject: [PATCH] adding stuff for www --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index c8f0c4b..87a8b36 100644 --- a/index.js +++ b/index.js @@ -6,8 +6,10 @@ const app = express() app.get('*', (req, res) => { const subdomain = req.subdomains[0] + if (!subdomain) return res.redirect(process.env.REDIRECT) if (req.path == '/') return res.redirect(process.env.REDIRECT) + if (!keys[subdomain]) return res.redirect(`${process.env.REDIRECT}${req.path}`) if (subdomain == 'media') return res.redirect(`https://link.storjshare.io/raw/${keys[subdomain]}/media${req.path}`) else return res.redirect(`https://link.storjshare.io/raw/${keys[subdomain]}/video${req.path}`)