Image server
Last updated
Last updated
The image server is a simple nodejs express server that allows images to be uploaded with Multer and resizes the based on url scheme, resizing is done with the library.
See: https://github.com/Amsterdam/openstad-image-server
Http-bearer is used fo validating requests so only registered clients can upload images.
Knex migrations create the clients table for registering clients that are allowed to use the API.
The app url is used to return a full url after upload.
Images directory defaults to images, if doesn't get created, create it manually.
Run npm (or pm2, or whatever runner you use).
For every site create a row in the MySQL clients table. Generate a random token that's safe. Currently there is no interface for creating so create it command line or through an mysql interface like sequelpro or phpmyadmin. The seed will generate one if the ENV values is
Example with node.js, using node-fetch & form-data. Pass the access_token that you've generated for the client, can be in url or as header "Bearer: ${token}" make sure it's over HTTPS.
Example for creating a thumbnail resize and crop:
For throttle see options in .
For all options (resizing, cropping, filter, etc) check .