Skip to content

chrisdevwords/node-lambda-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS Lambda Boilerplate

Simple boilerplate for a simple NodeJS lambda function. Includes package script and CircleCI config.

CircleCI Coverage Status Dependency Status Dev Dependency Status Known Vulnerabilities

Requirements

Running Tests

This project includes Mocha and Chai. If you add to this, write more tests. And run them:

$ npm test

Contributing

The lint config is based on AirBnB's eslint. To lint the code run:

$ npm run lint

Compiling For Upload

Make sure the bin directory has executable permissions:

$ chmod +x ./bin/build.sh

If this throws an error, trying using sudo:

$ sudo chmod +x .bin/build.sh

Zip up source code and runtime dependencies by running:

$ npm run build

This should output files.zip to the project root for upload to the AWS Lambda Console.

Deploying w/ Circle CI

Included is a circle.yml file for deployment to AWS with CircleCI. This will:

  1. Run mocha tests.
  2. Publish a coverage report with coveralls.
  3. Publish a dependency status report with david.
  4. Deploy your code to AWS when master or develop is updated on github.

In order to deploy :

  1. configure AWS Permissions for your Circle CI account.
  2. Setup coveralls for your repo.
  3. Set the following environment vars in your Circle CI build console:
    • COVERALLS_REPO_TOKEN - access token for coveralls, used to publish a coverage report.
    • PROD_FUNCTION_NAME - the name of the AWS Lambda you want to build when master is pushed to github.
    • DEV_FUNCTION_NAME - (optional) the name of the AWS Lambda you want to build when develop is pushed to github.
  4. Be sure to replace references to node-lambda-boilerplate in the badges at the top of this README with the name of your repo.

About

Simple boilerplate for a simple NodeJS lambda function.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published