A Node.js Image Processing API, written in TypeScript.
This api receives image filename, edits images based on dimensions parsed in the query parameters, saves them and renders the resized images. It uses sharp module to process the images.
First clone the project here on github
git clone https://github.com/educhinski/image-processing-api.gitInstall the dependencies
npm installRun the project locally
npm run startRun the production
npm run start:prodRun the tests
npm run testFor style enforcing and formatting
npm run prettier && npm run lintThe server will run on localhost:3000/ and the api will be at /api/images
The following are the available filename:
- encenadaport
- fjord
- icelandwaterfall
- palmtunnel
- santamonica
Example queries
Correct:
http://localhost:3000/api/images?filename=fjord&width=300&height=300
Incorrect:
http://localhost:3000/api/images?filename=fjord
http://localhost:3000/api/images?filename=nonexistent
http://localhost:3000/api/images?filename=fjord&width=200
http://localhost:3000/api/images?filename=fjord&height=200
http://localhost:3000/api/images?filename=fjord&height=one