/image_processin_api_udacity

This project is for udacity in the Full Stack JavaScript Developer path

Primary LanguageJavaScript

image_processin_api_udacity

This project is for udacity in the Full Stack JavaScript Developer path

Tools

- Resizing images using Sharp - Express - TypeScript - Jasmine - Eslint - Prettier

- Port:3000

API Format for resizing images

localhost:3000/api/images?filename=santamonica&width=300&height=300

Scripts:

  • Install:
    npm install
  • Build:
    npm run build
  • Lint:
    npm run lint
  • Prettier:
     npm run prettier
  • Run unit tests:
    npm run test
  • Start server:
    npm run start

Start the Server:

The server will listen :

port:3000

Brief instructions
http://localhost:3000/

Endpoint to resize images
http://localhost:3000/api/images

Example:
localhost:3000/api/images?filename=santamonica&width=300&height=300

Usage:

To use the Image Processor API, send a request to the endpoint with the following query parameters:

  • filename : The filename of the image file to process as stored under assets/images
  • width : width of the image file
  • height : height of the image file

Tests:

Run unit tests

Start server

Build

Note:

original images: './assets/images'
thumbnail images in file: './assets/images/thumb'

Reference: