Author: Meet Usadadiya
How it works:
Client-Side Demo:
This tool is useful when creating responsive site. This tool can helpful with img tag using srcset attribute:
<img
srcset="
http://url/img/meet.jpg?width=480 480w,
http://url/img/meet.jpg?width=800 800w
"
sizes="(max-width: 600px) 480px,
800px"
src="http://url/img/meet.jpg?width=800"
alt="Meet"
/>
Start :
npm start
And this tool will start running on port 3000.
Run on Custom Port:
npm start port 1234
To run this tool on custom port, you have to specify port number using port argument.
Clean Cache:
npm clean-cache
This command will clear all cached images.
- Clone this repository.
- Install Dependencies using
npm install
oryarn install
- Run server by using
npm start
oryarn start
- Use following API to save images on server:
- Method: POST
- URL :
/upload
- Body Content-Type: multipart/form-data
- Field 1 Name: file
- Value: an image-file
- Header Name: name
- Header Value: An Image name to be on server
- Or you can just place images in
./public/img
folder
This will work with JPEG, PNG and SVG formats only. More features are coming soon....
PRs and Issues are welcomed. Thank You!