A simple image processing API, made as a submission for Udacity"s back-end development with NodeJS course first project.
- run
npm install
to install dependencies - run
npm run build
to compile TypeScript - run
npm run start
to start the application
You can also start the development server without compiling by running npm run dev
The project was made in the current Node LTS version 16.18.0.
run npm run test
to run all tests.
The tests cover the functionality of the /api/images endpoint as well as tests for the functions in the api/services directory.
The /tests
directory currently compiles inside the /dist
directory, it should be possible to separate them using another tsconfig
file but I haven"t had the chance to experiment with it yet.
npm run format
to run prettier and automatically fix formatting errors.npm run lint
to run ESLint on the source code without fixing errors.npm run lint:fix
to run ESLint on the source code and fix all fixable errors.npm run lint-format
runs thelint:fix
andformat
scripts.
The only current endpoint is /api/images/
, upon requesting it you should be able to see simple instructions on how to use the image resizing functionality.
You can request /api/images/:image
to get the full sized image if it exists.
Request /api/images/:image?width={width}&height={height}
to get a resized image with the dimensions {width}
and {height}
.
The application supports resizing to multiple sizes of the same image.
I have only tested jpgs and pngs, but the application should be able to correctly handle any image format that has a MIME type starting with image/