adding stuff for www
This commit is contained in:
parent
433d0d4e1b
commit
0bb989ee66
2
index.js
2
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}`)
|
||||
|
|
Loading…
Reference in New Issue