This project implements an OCR (Optical Character Recognition) service using a Node.js and Express backend. It provides a simple, RESTful API to extract text from image files using the Tesseract.js library.
- π‘ REST API: Exposes a
POST /ocr
endpoint to handle OCR tasks and aGET /
endpoint for health checks. - π§ Tesseract.js Powered: Uses the powerful Tesseract OCR engine for text recognition (defaults to English).
- π· Image Upload: Handles
multipart/form-data
image uploads usingmulter
. The image is processed directly from memory. - βοΈ Express Framework: Built with Express.js for easy setup and routing.
- π CORS Enabled: Includes CORS middleware to support cross-origin requests.
- π Environment Config: Loads config (e.g.,
PORT
) from a.env
file usingdotenv
. - β‘ Async/Await: Fully asynchronous, non-blocking operations.
- π¨ Error Handling: Middleware for clean error responses and server stability.
git clone https://github.com/Aaleen110/ocr-service.git
cd ocr-service
npm install