aboutsummaryrefslogtreecommitdiffstats
path: root/server.js
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-02-25 02:56:19 +0000
committerterminaldweller <devi@terminaldweller.com>2024-02-25 02:56:19 +0000
commitb10106e556a4eb1b6effc2cb3d2ac9a6ff376a56 (patch)
treee9f92c5ed42cbc1a248e837f3c20ac17d66c3d6a /server.js
parentupdated the slug for the DNS post (diff)
downloadblog-b10106e556a4eb1b6effc2cb3d2ac9a6ff376a56.tar.gz
blog-b10106e556a4eb1b6effc2cb3d2ac9a6ff376a56.zip
fixed the problem with dbs post slug
Diffstat (limited to 'server.js')
-rwxr-xr-xserver.js15
1 files changed, 8 insertions, 7 deletions
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);
}