This project was made for fun, part of my javascript framework studies.
Node.js https://nodejs.org/
Install the required npm packages:
npm install express multer tesseract.js
Start the server:
node server.js
The server will start on http://localhost:3000
.
POST /ocr
- Endpoint:
http://localhost:3000/ocr
- Form Data:
image
(file): The image file to be processed.
curl -X POST http://localhost:3000/ocr -F "image=@/path/to/your/image.png"
{
"text": "Recognized text from the image."
}
ocr-api/
├── controllers/
│ └── ocrController.js
├── uploads/
└── server.js
controllers/ocrController.js
: Contains the logic for processing images and performing OCR.uploads/
: Directory where uploaded images are temporarily stored.server.js
: Entry point of the application, sets up the Express server and routes.
This project is licensed under the MIT License - see the LICENSE file for details.