A simple image processing API, made as a submission for Udacity's back-end development with NodeJS course first project.
- run
npm installto install dependencies - run
npm run buildto compile TypeScript - run
npm run startto 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 formatto run prettier and automatically fix formatting errors.npm run lintto run ESLint on the source code without fixing errors.npm run lint:fixto run ESLint on the source code and fix all fixable errors.npm run lint-formatruns thelint:fixandformatscripts.
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/