Skip to content

Commit

Permalink
fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
joanfabregat committed Dec 2, 2024
1 parent a5eac69 commit 8c12af1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8c12af1

Please sign in to comment.