diff options
author | terminaldweller <thabogre@gmail.com> | 2022-03-04 18:24:35 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-03-04 18:24:35 +0000 |
commit | 612f9ee8d3d2959b838380d92f56f2e57345afce (patch) | |
tree | 375de74a8d775238acf0a7de05b4eaa1ab19a2b2 /server.js | |
parent | fixed the style issue. footers are now ok (diff) | |
download | blog-612f9ee8d3d2959b838380d92f56f2e57345afce.tar.gz blog-612f9ee8d3d2959b838380d92f56f2e57345afce.zip |
added helmet
Diffstat (limited to 'server.js')
-rwxr-xr-x | server.js | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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); }); |