All Projects → buildbreakdo → lambda-starter

buildbreakdo / lambda-starter

Licence: MIT license
AWS Lambda Starter Kit with latest Babel 7, Jest 24 and Webpack 4.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to lambda-starter

sls-photos-upload-service
Example web app and serverless API for uploading photos and saving to S3 and DynamoDB
Stars: ✭ 50 (+92.31%)
Mutual labels:  api-gateway
parser
arc.app, .arc, arc.json, arc.yaml, and arc.toml support
Stars: ✭ 20 (-23.08%)
Mutual labels:  api-gateway
spacesuit
API Gateway with URL remapping
Stars: ✭ 19 (-26.92%)
Mutual labels:  api-gateway
AspNetCore.ApiGateway
Asp Net Core Api Gateway Framework
Stars: ✭ 46 (+76.92%)
Mutual labels:  api-gateway
groot-api-gateway
API Gateway for the Groot project written in Arbor
Stars: ✭ 12 (-53.85%)
Mutual labels:  api-gateway
aws-tailor
AWS account provisioning and management service
Stars: ✭ 105 (+303.85%)
Mutual labels:  api-gateway
GatewayService
GatewayService (Ocelot).
Stars: ✭ 19 (-26.92%)
Mutual labels:  api-gateway
aws-lambda-router
Improved routing for AWS Lambda like SNS and ApiGateway
Stars: ✭ 90 (+246.15%)
Mutual labels:  api-gateway
apex-api-gateway-boilerplate
Boilerplate for AWS Lambda and API Gateway using Apex
Stars: ✭ 19 (-26.92%)
Mutual labels:  api-gateway
bobbycar
IoT Transportation demo using Red Hat OpenShift and Middleware technologies
Stars: ✭ 33 (+26.92%)
Mutual labels:  api-gateway
amazon-ivs-ugc-web-demo
This repository shows how you can build a compelling user-generated content (UGC) live streaming webapp with Amazon IVS.
Stars: ✭ 14 (-46.15%)
Mutual labels:  api-gateway
noiiice
a serverless blog built on NuxtJS, AWS, serverless framework, and irrational exuberance.
Stars: ✭ 42 (+61.54%)
Mutual labels:  api-gateway
data
[deprecated] Generate a DynamoDB data access layer from an .arc file. Automatically disambiguates testing (in memory) from deployment staging and production tables
Stars: ✭ 20 (-23.08%)
Mutual labels:  api-gateway
gobis
Gobis is a lightweight API Gateway written in go which can be used programmatically or as a standalone server.
Stars: ✭ 48 (+84.62%)
Mutual labels:  api-gateway
lambda-multipart-parser
This nodejs module will parse the multipart-form containing files and fields from the AWS lambda event object. It works very well parsing binary and text files.
Stars: ✭ 45 (+73.08%)
Mutual labels:  api-gateway
go2gql
graphql-go schema generator by proto files
Stars: ✭ 33 (+26.92%)
Mutual labels:  api-gateway
Quark
Quark is a streaming-first Api Gateway using Akka
Stars: ✭ 13 (-50%)
Mutual labels:  api-gateway
serverless-node-sequelize-rds-rest-api
Serverless rest api application with Node.js to perform simple CRUD operation using MYSQL database hosted on AWS RDS with Sequelize ORM
Stars: ✭ 43 (+65.38%)
Mutual labels:  api-gateway
lmdrouter
Go HTTP router library for AWS API Gateway-invoked Lambda Functions
Stars: ✭ 121 (+365.38%)
Mutual labels:  api-gateway
kong-plugin-api-response-merger
Kong API response merger plugin
Stars: ✭ 14 (-46.15%)
Mutual labels:  api-gateway

Lambda Starter Kit

  • to enable the latest JavaScript ES6 language features and simplification of code with the class syntax
  • Webpack to bundle only production dependencies to a single file, watch for changes and eliminate dead code
  • AWS Sam Local to emulate API Gateway locally so you can test your Lambda functions without deploying to AWS
  • Jest to test and confirm code works during development and before deploying to production

Installation

cd YourLambdaFunctionDirectory
git clone [email protected]:buildbreakdo/aws-api-lambda.git .
npm install

Create

To ensure correct assignment of IAM, role and permissions the recomendation is to initialize the lambda function manually on AWS.

  1. Create a Lambda Function using the AWS Console
  2. Update function-name in package.json with the name of the function you just created:
// package.json
...
  "scripts": {
    ...
    "update": "aws lambda update-function-code --function-name MyNewLambdaFunctionName --zip-file fileb://dist.zip --publish",
    ...
  }
...
  1. Install aws-cli
  2. npm run deploy to build, run tests and update your function to the latest code

Run Scripts

Build

Use webpack to build/index.js:

npm run build

Deploy

Build, execute tests in continuous integration mode (bail on failure) and update your Lambda function with the latest code:

npm run deploy

Test

Run jest tests:

npm run test

Run jest tests in continuous integration mode (hard exit on test failure):

npm run test:ci

Run Jest tests continuously and watch for changes:

npm run test:watch

Debug Jest tests with Chrome browser:
  1. Insert debugger on a line in your test
  2. npm run test:debug
  3. Open Chrome and navigate to about:inspect

Watch

Monitor src folder for changes and rebuild when changes occur.

npm run watch

Start

Used to be the case that we had to deploy a lambda function to test what would actually happen in a production environment. This is no longer the case, now we can emulate API Gateway and AWS Lambda locally using the AWS-SAM-CLI from Amazon. The template.yml file in the root of the repository is the configuration used by SAM Local (points to code in build/index.js).

Local Development Prerequisites. Running functions locally with SAM Local requires Docker to be installed and running.

npm install -g aws-sam-local
npm start

Starts the AWS SAM Local development server on http://127.0.0.1:3000. Open http://127.0.0.1:3000 in your browser to execute your Lambda function.

Note: You only need to restart SAM CLI if you update your AWS SAM template.

SAM Local will watch your build directory for changes and reload when changes occur. Be sure to run npm run watch to monitor your src directory (where you will be writing code) to ensure SAM Local always has the latest build/index.js. Happy coding!

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].