-
Notifications
You must be signed in to change notification settings - Fork 0
ferng edited this page Jul 29, 2020
·
2 revisions
npm install -g serverless- In the directory where you develop the service
serverless create --template aws-nodejs --path my-service- Go to IAM page > Users > new user
- Grant programmatic access
- Attach existing policies directly > AdministratorAccess
- Ignore tags
- Create User
serverless config credentials --provider aws --key xxxxxxxxxxxxxx --secret xxxxxxxxxxxxxxvi serverless.yml
stage: dev
region: eu-west-2 ```serverless deploy -v
# which will deploy everything and give you the endpoint
endpoints:
GET - https://v69b1ygn03.execute-api.eu-west-2.amazonaws.com/dev/users/create- and test it
serverless invoke -f hello -l- Configure npm
npm init- Install offline serverless
npm install serverless-offline --save-dev
# and configure it
vi serverless.yml
# add these lines
plugins:
- serverless-offline- Run it locally
serverless offline start
#this will then give you the available endpoint
http://localhost:3000/dev/users/create