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 testto 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-projectEnter the new directory
$ cd my-projectInstall the Node.js packages
$ yarn installDeploy your project
$ serverless deployDeploy a single function
$ serverless deploy function -f helloRun your tests using
$ npm run testWe 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!