Last active
September 21, 2021 13:41
-
-
Save Athelian/da4ab9744bf36aed7adfd24ad7f8a38d to your computer and use it in GitHub Desktop.
Benign frontend server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
< !DOCTYPE html > | |
<html> | |
<head> | |
<!-- web crawlers will read this --> | |
<meta name="og:title" property="og:title" content="<%= title %>" /> | |
<script> | |
// browser windows will activate this | |
window.location.href = "<%= redirectUrl %>"; | |
</script> | |
</head> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const app = express(); | |
const port = process.env.PORT || 8080; | |
app.set("views", [ | |
"views", // folder in root of project with .html page | |
// can add new endpoints here | |
]); | |
app.set("view engine", "ejs"); | |
app.get('/', function (request, response) { | |
response.render("news/articles/_article_id", { | |
// these variables are passed to the .ejs template | |
redirectUrl: "https://www.my-real-page.com/", | |
title: "My homepage" | |
}); | |
}); | |
app.listen(port, () => console.log(`Listening on port ${port}`)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment