Edit on github

#Hello World Node.js Example

Make sure serverless is installed. See installation guide.

#1. Create a service

serverless create --template aws-nodejs --path myService or sls create --template aws-nodejs --path myService, where 'myService' is a new folder to be created with template service files. Change directories into this new folder.

#2. Deploy

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

#3. Invoke deployed function

serverless invoke --function hello or serverless invoke -f hello

-f is shorthand for --function

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

{
    "statusCode": 200,
    "body": "{\"message\":\"Go Serverless v1.0! Your function executed successfully!\",\"input\":{}}"
}

Congrats you have just deployed and run your Hello World function!