Needs the serverless framework and an AWS account
- don't forget to set up your aws credentiasl
- don't forget to run
npm install
create the domains from the serverless.yml file:
sls create_domain --stage dev
sls create_domain --stage prod
...
create the environmental variables in AWS SSM
aws ssm put-parameter --name "/api.YOURDOMAIN.com/environment/{ENVIRONMENT_NAME_FROM_ABOVE}/fromAddress" --value "YOUR_VALUE" --type String
aws ssm put-parameter --name "/api.YOURDOMAIN.com/environment/{ENVIRONMENT_NAME_FROM_ABOVE}/toAddress" --value "YOUR_VALUE" --type String
aws ssm put-parameter --name "/api.YOURDOMAIN.com/environment/{ENVIRONMENT_NAME_FROM_ABOVE}/mailSubject" --value "YOUR_VALUE" --type String
deploy with
sls deploy --stage dev
default environment is dev
see if your api works:
curl -X GET https://dev-api.YOURDOMAIN.com
- handle google recaptcha (https://www.npmjs.com/package/express-recaptcha)
- error handling