https://github.com/kenvilar/serverless-nodejs-lambda-config
Serverless Backend using Node.js on AWS Lambda with Serverless Framework
https://github.com/kenvilar/serverless-nodejs-lambda-config
aws aws-lambda nodejs serverless
Last synced: 10 months ago
JSON representation
Serverless Backend using Node.js on AWS Lambda with Serverless Framework
- Host: GitHub
- URL: https://github.com/kenvilar/serverless-nodejs-lambda-config
- Owner: kenvilar
- Created: 2018-08-24T00:51:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T12:43:43.000Z (over 7 years ago)
- Last Synced: 2025-03-13T02:41:16.618Z (about 1 year ago)
- Topics: aws, aws-lambda, nodejs, serverless
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# serverless-nodejs-lambda-config
## Instruction
```
brew install awscli
npm install -g serverless
#deploy our first function
sls deploy
#invoke the lambda function, this will output "This is a test only"
sls invoke --function kenVilarFunction
#debug
sls invoke --function kenVilarFunction log
#alternative to sls invoke command
sls logs --function kenVilarFunction
#Redeploy the whole stack
sls deploy function --function kenVilarFunction
#this will output "This is a test only"
sls invoke --function kenVilarFunction
#since we've changed the configuration in the serverless.yml
sls deploy
curl
```
```
npm install --save uuid
```
## To store data
```curl
curl -X POST /todos --data '{"text": "My name is Ken Vilar"}'
```
## To retrieve data
```curl
curl /todos/
```
## To retrieve data with debug log (handy)
```
sls invoke --function getTodo --log --data '{"pathParameters": {"id": ""}}'
```