Express API powering HealthPath — AI-driven health query analysis using Google Gemini.
- Runtime: Node.js 18
- Framework: Express
- AI: Google Gemini (
gemini-3-flash-previewfor analysis,gemini-3-flash-previewfor suggestions) - File parsing: pdf-parse, mammoth (DOCX), Tesseract.js (OCR)
- Storage: Vercel Blob
npm installCreate .env:
API_KEY=your_google_generative_ai_key
BLOB_READ_WRITE_TOKEN=your_vercel_blob_token
npm start
# Server runs at http://localhost:3001Health check.
Analyze a health query. Returns structured diagnosis, tests, resolutions, and next steps.
Body:
{ "input": "I have a headache and fever" }Response: JSON with initialTests, possibleDiagnoses, fastestResolution, normalResolution, complexCases, nextSteps.
Get autocomplete suggestions for a health query.
Body:
{ "input": "chest" }Response:
{ "originalQuery": "chest", "suggestions": ["chest pain", "chest tightness", "chest infection"] }Upload a medical document (PDF, DOCX, JPEG, PNG) with a prompt. Extracts text via OCR/parsing, then queries the AI model.
Form data:
file— document (max 4.5 MB)prompt— health query string
Response: Same structure as /query.
| Type | Parser |
|---|---|
| pdf-parse | |
| DOCX | mammoth |
| JPEG/PNG | Tesseract.js OCR |