diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-02-25 02:56:19 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-02-25 02:56:19 +0000 |
commit | b10106e556a4eb1b6effc2cb3d2ac9a6ff376a56 (patch) | |
tree | e9f92c5ed42cbc1a248e837f3c20ac17d66c3d6a /server.js | |
parent | updated the slug for the DNS post (diff) | |
download | blog-b10106e556a4eb1b6effc2cb3d2ac9a6ff376a56.tar.gz blog-b10106e556a4eb1b6effc2cb3d2ac9a6ff376a56.zip |
fixed the problem with dbs post slug
Diffstat (limited to 'server.js')
-rwxr-xr-x | server.js | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -51,7 +51,7 @@ app.use(helmet.xssFilter()); app.use((req, res, next) => { res.setHeader( "Permissions-Policy", - "geolocation=(self),midi=(self),sync-xhr=(self),microphone=(self),camera=(self),magnetometer=(self),gyroscope=(self),fullscreen=(self),payment=(self),usb=(self)" + "geolocation=(self),midi=(self),sync-xhr=(self),microphone=(self),camera=(self),magnetometer=(self),gyroscope=(self),fullscreen=(self),payment=(self),usb=(self)", ); next(); }); @@ -64,7 +64,7 @@ app.use( scriptSrc: ["none"], styleSrc: ["self", "https:", "unsafef-inline"], }, - }) + }), ); app.use(morgan("combined")); @@ -74,6 +74,7 @@ async function enumerateDir() { } function renderAndSend_v2(req, res, slug) { + console.log(slug); model.blogPost .findOne( { slug: slug }, @@ -83,7 +84,7 @@ function renderAndSend_v2(req, res, slug) { title: 0, teaser: 0, }, - } + }, ) .exec(function (err, blogPost) { if (err) return err; @@ -186,14 +187,14 @@ if (process.env.SERVER_DEPLOYMENT_TYPE == "deployment") { { key: fs.readFileSync( "/etc/letsencrypt/live/blog.terminaldweller.com/privkey.pem", - "utf-8" + "utf-8", ), cert: fs.readFileSync( "/etc/letsencrypt/live/blog.terminaldweller.com/fullchain.pem", - "utf-8" + "utf-8", ), }, - app + app, ) .listen(process.env.SERVER_LISTEN_PORT || 9000); } else if (process.env.SERVER_DEPLOYMENT_TYPE == "test") { @@ -203,7 +204,7 @@ if (process.env.SERVER_DEPLOYMENT_TYPE == "deployment") { key: fs.readFileSync("/certs/server.key", "utf-8"), cert: fs.readFileSync("/certs/server.cert", "utf-8"), }, - app + app, ) .listen(process.env.SERVER_LISTEN_PORT || 9000); } |