An image resizing service to sit behind a dynamic cache (like CloudFront).
Install Servo with npm.
npm install -g servo
Set up your configuration (see below) and simply run
Servo uses a JS/JSON file for configuration that needs to be passed in through a
SERVO_CONFIG environment variable.
Servo responds to a few requests.
No authentication is required for this request. If specific image at the requested size and extension has yet to be generated, it will be generated on the fly, otherwise the cloudfront cache should catch it. If authenticated, will redirect to a signed URL for the requested resource.
(requested resource or empty body and error status code)
PUT /[explicit route]servoKey=servoKey(file=@imgA.jpg) OR (key=s3Key [bucket=default-bucket])routine=strip;scale:100,100 (optional)
A Servo Key is required in the header of the request to PUT resources into S3.
When an explicit route is not specified, files are saved as their hashed value.
The resource mime type is extracted from the file's extension and stored as a
header in S3. An optional
routine option may be added to put the image through
a series of GraphicsMagick operations before uploading.
A Servo Key is required in the header of the request to DELETE resources in S3. The request simply returns a 200 status and empty JSON object on success.
204 No Content