This template service gives you the latest in modern JavaScript (ES6 via Webpack + Babel, testing with Jest, linting with ESLint, and formatting with Prettier), the ease and power of Serverless, and bootstrapped DynamoDB and S3 infrastructure.
Once installed, you can create and deploy functions with the latest ES6 features in minutes, with linting and formatting baked in.
# Install dependencies
yarn install
# Start local API gateway
yarn start
Jest is installed as the testrunner. To create a test, co-locate your test with the file it's testing
as <filename>.test.js
and then run/watch tests with:
yarn test
Assuming you've already set up your default AWS credentials:
yarn deploy
yarn deploy
will deploy to the development
environment. You can deploy to staging
or production
with:
yarn deploy:staging
# -- or --
yarn deploy:production
After you've deployed, the output of the deploy script will give you the API endpoint for your deployed function(s), so you should be able to test the deployed API via that URL.
Assuming you're finished with your environment, you can delete the stack with:
yarn cleanup
yarn cleanup
will remove the development
environment.