Here's how to test the API using npm run
command:
start
: builds the project and starts the servertest
: builds and run th tests contained insrc/tests
dev
: startnodemon
onsrc/index
clean
: removebuild
folderbuild
: run typescript compiler && output the result inbuild
directoryformat
: uses prettier to format the codelint
: uses ESLint to lint the codelint:fix
: linting and fixing
Server port is 3000
The only existing endpoint is /api/images
and you have to give it query params (filename - width - height) to work
-
The API doesn't allow for negative numbers or wrong typee of parameters you give in the query param
-
Images are stored in
storage/images
-
The output file is
storage/thumbs
and is created when hitting the endpoint for the first time
http://localhost:3000/api/images?filename=fjord&width=400&height=200