项目作者: Zahidul-Islam

项目描述 :
Capture high quality website screenshots using Thumbnail Microservice API
高级语言: JavaScript
项目地址: git://github.com/Zahidul-Islam/thumbnail-microservice.git
创建时间: 2017-09-24T07:39:25Z
项目社区:https://github.com/Zahidul-Islam/thumbnail-microservice

开源协议:Other

下载


Thumbnail Microservice

Capture high quality website screenshots using Thumbnail Microservice API

screenshot

Getting Started

Installation

To use Thumbnail Microservice API clone the GitHub repository.

  1. git clone https://github.com/Zahidul-Islam/thumbnail-microservice.git
  2. cd thumbnail-microservice.git
  3. npm install

Update environment variables

Rename .env.template file to .env using mv .env.template .env

Update properties in .env file

  1. PORT=8000
  2. AWS_REGION=<YOUR_AWS_REGION>
  3. AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY_ID>
  4. AWS_SECRET_ACCESS_KEY=<YOUR_AWS_SECRET_ACCESS_KEY>
  5. S3_BUCKET_NAME=<YOUR_S3_BUCKET_NAME>

Run npm run dev

Thumbnail Microservice API is running on www.localhost:8000

API documentation

Making an API request

The url format for making a REST api request to Thumbnail Microservice is:

  1. http://<thumbnail-micorservice-api>/api/v1/thumbnails/?REQUEST_OPTIONS

Where:

REQUEST_OPTIONS should be replaced by a query string that contains all of the options you want to set.

Request Options

Below is a table listing all of the available options to the API.
Combine these options as parameters in the query string for e.g. ?url=google.com&size=window






























Option Example Value
size
  1. window/all

viewport
  1. width x height (1024x768)

quality 75
renderDelay 0
timeout 0

The full HTTP url could be:

http://localhost:8000/api/v1/thumbnails/?url=google.com&size=window&viewport=600x800&quality=90&renderDelay=2000&timeout=4000

License

Copyright (c) 2017, Zahidul Islam. (MIT License)

See LICENSE for more info.