this project uses nodejs with dependencies to process the image and return it with specific width and height
nodejs is required and can be downloaded from the following link https://nodejs.org/en/download/
- Prettier for formatting
- Lint to flag programming errors
- Express to build and start the server
- Sharp to process the image to the required width and height
- Jasmine to write test cases for the code
run npm install in the root folder to download all the required dependencies to start the application
make sure yarn is installed as well by typing the following commad npm install --global yarn
- the base URL for this app is the
localhost:5000orhttp://127.0.0.1:5000you can change the port number in the code to your desire in the src/index.ts file
- 200 OK , succesful
- 400 bad request , errors
these are the end points you can access by writing the end point after the localhost address ,for example http://127.0.0.1:5000/images
http://127.0.0.1:3000/main page and have the instructions to follow to use the API
http://127.0.0.1:3000/imagesto view the images folder and content inside it
http://127.0.0.1:3000/images/api?filename={your name file name.jpg}to view the imagehttp://127.0.0.1:3000/images/api?filename={your name file name.jpg}&width={width}&height={height}to generate the image in the desired width and height , stored in the resized folder inside /images folder- you can't enter invalid file name , will generate code 400 bad request, or entering invalid parameters either only width or only height without each other also will generate the 400 status code.
npm startto build and run the projectnpm run testto run the written test with jasmine and check the casesnpm run formatto format the project .ts files in the src folder according to the .prettierrc settings inputed therenpm run lintto run lint and check for errorsnpm run Buildto build the .ts files and generate the .js files in the build folder