Giter VIP home page Giter VIP logo

hdx-snap-service's Introduction

HDX Snap Service

Installing

  1. Clone repo
  2. npm install
  3. npm run start

Usage

  1. Check service is running by performing GET on /ping
  2. Snap a website by making a GET request on /png with the following parameters:
    1. url - mandatory - url of the website, eg. /png?url=http://google.com
    2. fileName - optional - resulting file name, eg. /png?url=http://google.com&fileName=google.png
    3. selector - optional - snap only a part of the website described by a selector, eg. to get only the google logo by targeting element with id #hplogo: /png?url=http://google.com&selector=%23hplogo
    4. viewport - optional - provide optional parameters to alter snap service viewport, documentation here - eg. set width to 1280 and height to 1 (symbolic, will snap the whole page anyway) to : /png?viewport={"width":1280,"height":1}&url=http://google.com
    5. timeout - optional - set page load timeout during snapshot, eg. wait 60 seconds : /png?timeout=60000&url=http://google.com

Development

  1. Clone repo
  2. npm install
  3. npm install -g nodemon
  4. npm run develop

To build the Docker image: docker build --no-cache -t hdx-snap-service:latest . To start it: docker run -d --name hdx-snap-service --shm-size=1G --cap-add=SYS_ADMIN -p 8080:80 hdx-snap-service:latest Start with path mapping: docker run -d --name hdx-snap-service --shm-size=1G --cap-add=SYS_ADMIN -v <PATH_TO_YOUR_DEV_DIR>:/srv/www -p 8080:80 hdx-snap-service:latest

hdx-snap-service's People

Contributors

aalecs avatar teodorescuserban avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.