aboutsummaryrefslogtreecommitdiffstats
path: root/server.js
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-03-04 18:24:35 +0000
committerterminaldweller <thabogre@gmail.com>2022-03-04 18:24:35 +0000
commit612f9ee8d3d2959b838380d92f56f2e57345afce (patch)
tree375de74a8d775238acf0a7de05b4eaa1ab19a2b2 /server.js
parentfixed the style issue. footers are now ok (diff)
downloadblog-612f9ee8d3d2959b838380d92f56f2e57345afce.tar.gz
blog-612f9ee8d3d2959b838380d92f56f2e57345afce.zip
added helmet
Diffstat (limited to '')
-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);
});