2016-10-24 19:11:37 -07:00

1004 B

Read this on the main serverless docs site

Web API with AWS Lambda in Node.js

This example demonstrates how to create a web api with AWS Gateway and Lambda.

Steps

1. Configure your endpoint

In your serverless.yml file, configure a function and http to the events with path and method.

2. Deploy

serverless deploy or sls deploy. sls is shorthand for the serverless CLI command.

After you deploy your function. Serverless will setup and configure the AWS

2. Invoke the remote function

In your terminal window you should be the response from AWS Lambda

{
  "message": "Hello World",
  "event": {}
}

Congrats you have just deployed and ran your hello world function!