This is a Node.js application that provides image processing functionality through a RESTful API. It allows users to resize images through HTTP requests.
- Node.js
- npm
- Clone the repository
- Run
npm install
to install the dependencies - Run
npm start
to start the server - The server will be listening on
http://localhost:3000
GET /fullimages/filename
: Returns the full image with the specified filename.GET /api/resize/?filename&width=100&height=100
: Returns a resized image with the specified dimensions. If only one dimension is provided, the other will be scaled proportionally.
- To retrieve the full image named
a.jpg
, send a GET request tohttp://127.0.0.1:3000/fullimages/a.jpg
- To retrieve a resized version of the same image with a height 200px and width of 200px, send a GET request to
http://127.0.0.1:3000/api/resize?image=a&height=200&width=200
To run the unit tests, use the following command:
npm run test