Estruturação rápida de “postos de triagem” virtuais descentralizados para redução de visitas desnecessárias às emergências
Production | Development |
---|---|
Make sure bash
is available from your terminal
$ npm install serverless -g
$ serverless login
$ npm install
DANGER you must know exactly what you are doing here!
- Log into your Serverless Dashboard and create a new app reflecting serverless.yml "service" field
- Deploy the frontend, it's needed to create the CloudFront distribution
$ NODE_ENV={stage_name} npm run deploy:frontend
- Create a distribution pointing to the frontend bucket
- Don't forget to create a custom error response for 404 and other errors
- Create a Route53 Hosted Zone with the api host
- Create the APIGateway domain
$ NODE_ENV={stage_name} sls create_domain
- Verify if the serverless.yml
provider.deploymentBucket.name
bucket exists. Create if needed. - Deploy the service
$ serverless deploy
$ NODE_ENV=development|production npm run deploy
$ NODE_ENV=development|production npm run deploy:frontend
$ NODE_ENV=development|production npm run deploy:backend
- Open the AWS Console, open the API Gateway service and find your deployed service
- Navigate to
Authorizers
tab and you shall see theauthorizer
- Click
Edit
, checkAuthorization Caching
and clickSave
- Click
Edit
again, uncheckAuthorization Caching
and clickSave
- Redeploy the application
- Yes, it sucks!