aboutsummaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/app.js b/app.js
index 51c8958..1a6f8ab 100644
--- a/app.js
+++ b/app.js
@@ -56,7 +56,7 @@ app.use("/:repo", async (req, res, next) =>
next();
})
-app.get("/:repo", (req, res, next) =>
+app.get("/:repo", (req, res) =>
{
res.redirect(`/${req.params.repo}/log`);
});
@@ -72,6 +72,17 @@ app.get("/:repo/:page", (req, res, next) =>
res.sendFile("dist/app.html", { root: __dirname });
});
+app.get("/:repo/log/:hash", (req, res, next) =>
+{
+ const valid_hash = /^[0-9a-f]+$/;
+ if(!valid_hash.test(req.params.hash)) {
+ next();
+ return;
+ }
+ res.sendFile("dist/app.html", { root: __dirname });
+});
+
+
app.get("/", (req, res) =>
{
res.sendFile("dist/app.html", { root: __dirname });