an image processing API that I made as part of my Full Stack JavaScript Developer Nanodegree from Udacity.
Currently the functionality is limited to resizing and processing images and setup an image caching system.
It demonstrates my understanding of Typescript, NodeJS, NodeJS Middleware, Express, Express Router, Endpoints, Node File Management, Unit Testing.
NodeJS was used for the runtime.
Express was used for the backend.
Jasmine was used for the unit testing.
Sharp was used for the image processing.
Typescript was used as the programming language.
Endpoints
Endpoint | Request | Parameters | Response | Usage |
---|---|---|---|---|
/ | GET | N/A | 200 | Root Route |
convert | GET | filename, width, height | 200 | Resize Images |
A full suite of tests are ready to use that cover all endpoints and helper functions
You can use
npm run test or yarn test
To start the unit testing
+---assets
| | DSOTM.jpg
| | okComputer.jpg
| | icelandwaterfall.jpg
| | UnknownPleasures.jpg
| |
| \---thumbnails
|
+---spec
| \---support
| jasmine.json
|
\---src
| index.ts
|
+---middleware
| loggerMiddleware.ts
|
+---router
| | index.ts
| |
| \---api
| resize.ts
|
+---tests
| +---endpointsSpecs
| | resizeSpec.ts
| | indexSpec.ts
| |
| +---helpers
| | reporter.ts
| |
| \---utilitiesSpecs
| handleFileSpec.ts
|
\---utilities
handleFile.ts
handleImage.ts
You can get the project up and running in simple steps.
npm install or yarn
Then you can use the following endpoint to process your images.
http://localhost:3000/resize?filename=UnknownPleasures&width=700&height=400