aboutsummaryrefslogtreecommitdiffstats
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rwxr-xr-xserver.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/server.js b/server.js
index 94a6082..ec4350e 100755
--- a/server.js
+++ b/server.js
@@ -20,6 +20,9 @@ const mit = require("markdown-it")({ html: true })
code: true,
});
const spdy = require("spdy");
+const helmet = require("helmet");
+const morgan = require("morgan");
+const pug = require("pug");
const app = express();
app.use(express.static(path.join(__dirname, "css")));
@@ -27,6 +30,8 @@ app.use(express.static(path.join(__dirname, "static")));
app.set("views", path.join(__dirname, "views"));
app.set("view engine", "ejs");
app.engine("ejs", require("ejs").__express);
+app.use(helmet());
+app.use(morgan("combined"));
function renderAndSend(req, res) {
try {
@@ -85,6 +90,11 @@ app.get("/robots.txt", (req, res) => {
res.send(robots_txt);
});
+// app.get("/rss/feed", (req, res) => {
+// let html = pug.renderFile("./views/rss_feed.pug", merge(options, localls));
+// res.send(html);
+// });
+
app.get("/$", (req, res) => {
renderAndSend(req, res);
});