- Install AWS CLI
- Add an IAM user with proper access, then set up
aws configuration, read docs here - Clone this project
- Run
npm i - If you want to invoke function locally, try
npx serverless invoke local -f [function name] --data '{ "pathParameters": {"id":"userID"}}'
Ex.
npx serverless invoke local -f listUser - If you want to deploy to cloud, make sure you have configured aws credentials (the step 2), then run
npx serverless deploy
| Item | Value |
|---|---|
| Method | GET |
| path | /users |
| param |
| Item | Value |
|---|---|
| Method | GET |
| path | /user/{id} |
| param | required |
| Item | Value |
|---|---|
| Method | POST |
| path | /user |
| param | required |
{
"occupation":"Thor",
"isActive":true,
"name":"Chris Hemsworth",
"age": 38
}
| Item | Value |
|---|---|
| Method | PUT |
| path | /user/{id} |
| param | required |
{
"occupation":"Thor",
"isActive":true,
"name":"Chris Hemsworth",
"age": 31
}
| Item | Value |
|---|---|
| Method | DELETE |
| path | /user/{id} |
| param | required |