summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@yandex.com>2021-09-16 16:43:42 +0200
committermetamuffin <metamuffin@yandex.com>2021-09-16 16:43:42 +0200
commit3f0a762ace654e7d359c3f093dca7d1946cb14e2 (patch)
treee93c851be6a0a43fc741b72001b45dd1bbcf8a55
parent239578626ef1a6b06a4dfd3e7da42adf619d9a1b (diff)
downloadmetamuffin-website-3f0a762ace654e7d359c3f093dca7d1946cb14e2.tar
metamuffin-website-3f0a762ace654e7d359c3f093dca7d1946cb14e2.tar.bz2
metamuffin-website-3f0a762ace654e7d359c3f093dca7d1946cb14e2.tar.zst
bugfixes and optimization
-rw-r--r--source/index.ts7
-rw-r--r--views/layout.pug2
2 files changed, 9 insertions, 0 deletions
diff --git a/source/index.ts b/source/index.ts
index e22478e..dac1b2d 100644
--- a/source/index.ts
+++ b/source/index.ts
@@ -12,6 +12,8 @@ const render_env = {
commit: readFileSync(join(__dirname, "../.git/refs/heads/main")).toString().substr(0, 8)
}
+app.disable('x-powered-by');
+
app.set("view engine", "pug")
app.set("views", join(__dirname, "../views"))
@@ -26,6 +28,11 @@ app.get("/licence", async (req, res) => {
res.type("text/plain").send(content)
})
+app.get("/favicon.ico", (req,res) => res.sendStatus(204)) // no content
+app.get("/robots.txt", (req,res) => {
+ res.send("User-Agent: *\nDisallow: /")
+})
+
const PORT = parseInt(process.env.PORT ?? "8080")
const HOST = process.env.HOST || "127.0.0.1"
diff --git a/views/layout.pug b/views/layout.pug
index 2d960f7..c1479b2 100644
--- a/views/layout.pug
+++ b/views/layout.pug
@@ -1,7 +1,9 @@
+doctype html
// SPDX-License-Identifier: AGPL-3.0-only
html(lang="en")
head
meta(charset="UTF-8")
+ meta(name="viewport", content="width=device-width, initial-scale=1.0")
title metamuffin.org
body
header