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 installDANGER 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.namebucket 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
Authorizerstab and you shall see theauthorizer - Click
Edit, checkAuthorization Cachingand clickSave
- Click
Editagain, uncheckAuthorization Cachingand clickSave - Redeploy the application
- Yes, it sucks!