From 1bbfbf399fb7c5aee509889600fa476e1a877612 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Mon, 19 Feb 2024 16:53:32 -0600 Subject: [PATCH] :id/log instead of /log/:id --- src/main.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.ts b/src/main.ts index 1133286..d1d3d4a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -70,6 +70,17 @@ app.get('/:id', async (req, res) => { } }); +app.get('/:id/log', async (req, res) => { + const logFile = logForRequest(req.params.id); + if (!logFile) { + res.sendStatus(410); + return; + } + + res.send(readFileSync(logFile)); +}); + +// deprecated app.get('/log/:id', async (req, res) => { const logFile = logForRequest(req.params.id); if (!logFile) {