Git Product home page Git Product logo

node-phantomjs-aws-lambda's Introduction

PhantomJS Lambda Template

A PhantomJS node.js app for Amazon Lambda. Based on node-lambda-template using node-lambda. The app includes a PhantomJS binary (phantomjs) compiled for AWS Linux (https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2).

Setup

Install dependencies using npm. It'll install the AWS SDK as well as PhantomJS on the development machine.

npm install

Usage

After installing use the following npm commands as described below. They're only wrapping the node-lambda functionality to allow node-lambda to be installed only locally. Additional params can be provided using -- args. For a list of available options see the node-lambda documentation.

Run the setup command to generate the environment file with the configuration used for the Amazon Lambda function. Edit the resulting .env. file with your custom settings.

For this you need to have aws account and fill out confuguration in .env file:

AWS_ACCESS_KEY_ID=your_aws_key_id AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key AWS_ROLE_ARN=your_amazon_role AWS_REGION=us-east-1 ....

npm run setup

To run the function locally execute the following command.

npm run start

Run the following command to deploy the app to Amazon Lambda.

npm run deploy

Note: npm version 2.x or newer required to pass arguments to the scripts using -- args

Building phantomjs

If you want to use a different version of phantomjs or have trouble with the included version, follow the instructions in build-phantomjs.sh.

node-phantomjs-aws-lambda's People

Contributors

narainsagar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.