A Serverless starter that adds ES6, TypeScript, linting, and unit test support. Part of the Serverless Stack guide.
Serverless Node.js Starter uses the serverless-esbuild plugin. It supports:
- Generating optimized Lambda packages with Webpack
- Using ESNext or TypeScript in your handler functions
- Support for unit tests
- Run
yarn run test
to run your tests
- Run
- Sourcemaps for proper error messages
- Error message show the correct line numbers
- Works in production with CloudWatch
- Lint your code with ESLint
- No need to manage Webpack or Babel configs
To create a new Serverless project.
$ serverless install --url https://github.com/renanwilliam/serverless-nodejs-starter --name my-project
Enter the new directory
$ cd my-project
Install the Node.js packages
$ yarn install
Deploy your project
$ serverless deploy
Deploy a single function
$ serverless deploy function -f hello
Run your tests using
$ npm run test
We use Jest to run our tests. You can read more about setting up your tests here.
We use serverless-esbuild to create the bundle. It works with Typescript and Javascript projects.
We use Prettier to format your code via npm run prettier-format
.
We use Typescript ESLint to lint your code via npm run eslint
.
- Open a new issue if you've found a bug or have some suggestions.
- Or submit a pull request!