From b10106e556a4eb1b6effc2cb3d2ac9a6ff376a56 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sat, 24 Feb 2024 21:56:19 -0500 Subject: fixed the problem with dbs post slug --- server.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 7e45b31..49b107f 100755 --- a/server.js +++ b/server.js @@ -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); } -- cgit v1.2.3