First project.
An API project built with Node.js, it's allows you to resize images via URL parameters.
An additional feature of your images, all resized images are saved in the thumb
folder this means all images are cached, which allows to reduce page loading size. Instead of having to resize and upload multiple copies of the same image to use throughout your site.
This application is run a node.js site provides a REST endpoints.
-
To start the site please run the following script to install all needed packages for the project":
npm install
-
After installing packages run the following script to start the site:
npm run start
Here you can find the scripts which may help you. You can run one of the following scripts with the following command npm run <ScriptName>
Script Name | Description |
---|---|
build | Creates a build directory named dist with a production build of your app |
jasmine | Running Jasmine specs |
test | Run both build & jasmine scripts |
format:check | Check that all files formatted and match prettier code style |
format:fix | This rewrites all processed files and formats files in the current directory |
lint:check | Checking of your source code for programmatic and stylistic errors |
lint:fix | Automatically fix problems and stylistic errors |
The site will run on port 3000 (default) you can change it from the config.env
Here.
Base URL is : http://localhost:3000
Now find the available endpoints:
Expected query parameters are:
- imageName
Images can found in
assets/images/full
Here. - width
- height
All parameters are required
This endpoint allow you to delete all thumbs images (Cached images).