This project is a part of Udacity-FWD-Advanced web development track.
npm install
Building an API with scalable and maintainable code that can be used in two different ways :
- Placeholder API : place images with the size set via URL parameters.
- Image Scaling Library (sharp): serve properly scaled versions of images to reduce page load size.
- TypeScript
- Prettier (Formating)
- EsLinter (Linting)
- Jasmine (Unit Testing)
- Sharp (Image processing)
- Express (Building the server)
- assets: images and any styling files
- middlewares: middlewares functionalities
- routes: writing routes and organizing EndPoints
- tests : building unit testing with jasmine (it is written in the same style of file structure of src directory)
- utilities: any helper functions.
- index.ts : main file where the server is built
- npm run prettier
- npm run lint
- npm run build >> transpiling files to javascript to be ready for production
- npm run test >> for unit testing
- npm run start >> start server
-
/api/processimg
-
It accepts the following query parameters:
- name >> img file name
- width >> required width
- height >> required height
- Examples:
- /api/processimg?name=fjord >> Placeholder API
- /api/processimg?name=fjord&width=200&height=200 >> for Image Scaling
Processing hundreds of images with multiple thumbnail sizes for an eCommerce solution.