From 8c12af1771229494b680653bf1e6b142e9d3193b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Fabr=C3=A9gat?= Date: Mon, 2 Dec 2024 14:45:45 -0800 Subject: [PATCH] fixes #1 --- main.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.mjs b/main.mjs index 992bb9d..ddd1e08 100644 --- a/main.mjs +++ b/main.mjs @@ -17,6 +17,19 @@ const tempDir = 'temp'; const app = express(); const upload = multer({dest: tempDir}); +/** + * Health check endpoint + */ +app.get('/health', (req, res) => { + res.json({ + status: "up", + timestamp: new Date().toISOString() + }); +}); + +/** + * Extract text from a PDF file + */ app.post('/extract', upload.single('file'), async (req, res) => { if (!req.file?.filename) { res.status(400);