- Install
nvm
(Node Version Manager) cd
to the project directory and execute the following:nvm install nvm use npm install
This project uses EditorConfig for IDE configuration.
See .editorconfig
for settings.
Many popular IDEs and editors support this out of the box or with a plugin.
- Install AWS CLI for your computer
- Setup AWS CLI with your credentials
- Add a configuration for
serverless
in your AWS config files
- Follow the instructions at serverless-domain-manager for registering and setting up a domain name
- Create
test-api.whatever.com
certificate - Create
api.whatever.com
certificate
- Create
- Change the base
custom.baseDomainName
property inserverless.yml
to the zone name, egwhatever.com
- Then run:
npx serverless create_domain --stage test
Use serverless to run the server locally:
npx serverless invoke local -f graphql -p examples/invoke-data/query.json
AWS_SDK_LOAD_CONFIG=true npx serverless offline
Use serverless to run the server against the test environment:
npx serverless invoke --stage test -f graphql -p examples/invoke-data/query.json
This project uses Prettier, so please run it before checking in:
npm run pretty
See .prettierrc
for settings.
Some IDEs and editors have plugins for running Prettier.
This project uses ESLint. Check linting before checking in:
npm run lint
See tslint.json
for settings.
Many IDEs and editors support TSLint.
This project uses Jest for testing. Run tests before checking in.
npm test
npm run build
NOTE: AWS Certificate validation requires a manual step during the first deployment.
When the following is displayed, go to the AWS Certificate Manager console for the new domain name and create the record in Route 53:
CloudFormation - CREATE_IN_PROGRESS - AWS::CertificateManager::Certificate - WebAppCertificate
npm run deploy
npx serverless logs --stage test -t -f graphql
npm run deploy:prod
npx serverless logs --stage prod -t -f graphql
If there are errors when deploying, check the Cloudformation logs for the stack.