- Install Node.js locally and initialise a new project by running
npm init --y
.
- Install Typescript and Express.js.
npm run build
will perform the transpilation from TypeScript to JavaScript.
npm run test
will perform all the testing as well as producing a 'build' directory.npm run lint
andnpm run prettier
will perform all code formatting checks.npm run lint-fix
will perform any necassary error corrections.
- Run
node build/src/index
from the project's root directory.
- Run
npm run start
from project's root directory.
- Main route: http://localhost:3000
- API:
- http://localhost:3000/api/images?filename=myFile.jpg will reproduce
myFile.jpg
as it exists in theimages
directory. - http://localhost:3000/api/images?filename=myFile&width=some_width&height=some_height, where
some_width
andsome_height
are postive integers, will produce a resized image and place it in the newly-createdthumbnails
directory in the root of the project. - Refreshing the browser or making a previously requested resized image will have no effect on the
thumbnails
directory (caching).