small dynamic file server for images (used in picturehouse.be (https://github.com/kdssoftware/picturehouse))
Pulling:
docker pull ghcr.io/kdssoftware/image-upload-server:latest
running:
docker run -e HOST=http://localhost:4000 -e CORS=http://localhost:3000 -p 4000:8181 --name image-upload-server ghcr.io/kdssoftware/image-upload-server
-
POST /
Add new pictures to the serverWhere 'files[]' in the body are sent (in Binary).
Response:
[ { "url":"http://localhost:3000/05b98fa9-c59c-429b-b911-32d9d96d2e0b.jpeg", "file":"05b98fa9-c59c-429b-b911-32d9d96d2e0b.jpeg", "width":500, "height":700 } ]
-
GET /[filename]
The filename is default
[uuid].[file-exstension]
(example:05b98fa9-c59c-429b-b911-32d9d96d2e0b.jpeg
)To receive an altered file put the type in front of the filename (example
[type]-[filename]
)There are 3 types:
- compressed: reduces the quality of the image to 30%
- blur: ads a blur to the picture and reduces to image to 20%
- cropped: crops the picture to a square and reduces the image to 30%
example of request:
http://localhost:3000/cropped-05b98fa9-c59c-429b-b911-32d9d96d2e0b.jpeg
Response: The picture in Binary
Info: the altered files will be automatically created when a new file is uploaded, to ensure the best speed. If the file was not created (for example taking longer to alter the file) it will alter the file on-demand