Skip to content

mahmoudahme/imageProccesingApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scripts

  • Run unit tests: npm run test
  • Start server: npm run start

Usage

The server will listen on port 3000:

Brief instructions

http://localhost:1000/

Endpoint to resize images

http://localhost:1000/api/images

Expected query arguments are:

  • filename: Available filenames are:
    • encenadaport
    • fjord
    • icelandwaterfall
    • palmtunnel
    • santamonica
  • width: numerical pixel value > 0
  • height: numerical pixel value > 0

Example 1

http://localhost:3000/api/images Will display a hint and list available image names

Example 2

http://localhost:3000/api/images?filename=fjord&width=200&height=200 Will scale the fjord image to 200 by 200 pixels and store the resulting image. On subsequent calls will serve the resized image instead of resizing the original again.

Example 3

http://localhost:3000/api/images?filename=fjord&width=-200&height=200 Invalid width parameter that will be hinted to.

Example 4

http://localhost:3000/api/images?filename=fjord&width=200 Missing height parameter that will be hinted to.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published