Skip to content

Commit

Permalink
mask domain
Browse files Browse the repository at this point in the history
  • Loading branch information
rosano committed Feb 28, 2024
1 parent fbab1be commit 43eeee1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,17 @@ app.use(function archiveDomain (req, res, next) {
return res.redirect(301, map[req.get('host')]);
});

app.use(function maskDomain (req, res, next) {
const map = {
'appindex.app': 'https://utopia.rosano.ca/instant-app-index/',
};

if (!Object.keys(map).includes(req.get('host'))) {
return next();
}

return res.send(`<!DOCTYPE html><html><head><meta charset="utf-8" /></head><body><iframe style="border: none;" src="${ map[req.get('host')] }"></iframe><style>html,body,iframe { width: 100vw; height: 100vh; padding: 0; margin: 0; }</style></body></html>`);
});


app.listen(process.env.PORT);

0 comments on commit 43eeee1

Please sign in to comment.