- Install Node.js
- Clone the repository
git clone https://github.com/salmantec/Image-Processing-API.git - Install dependencies
cd Image-Processing-APIandnpm install - Run
npm run start - Navigate to
http://localhost:5000/apito check express server is working or not. - You'll see the following message as a response
Main api route
- Run
npm run test
- Run
npm run build - Once build is done, to start the app run
node dist/index.js
- Run
npm run lint- to check the linting errors - Run
npm run prettier- It'll automatically prettify the codes.
- Add few images (in .jpg format) under
public/fullImages - Start the application
- Hit the
localhost:5000/api/images?filename=fjord&width=200&height=200URL from your browser. Herefilename,widthandheightare mandatory query parameters - You will get the resized image based on the width and height that you've added in the url.
- You can see that resized images under
public/thumbImages. - If you pass the same image name with same width and height, server will serve the images from
public/thumbImagesinstead of resizing the images every time.