TypeScript ncc serverless Template (direct0)

Quickly bootstrap a serverless project using TypeScript (built with ncc).

This creates a serverless project intended for direct lambda invocation. For a project fronted by API Gateway, see https://github.com/kyledetella/typescript-ncc-serverless-template.

Features:

  • TypeScript (compiled using ncc)
  • Jest configured out-of-the-box
Table of Contents

Usage

npx serverless create --template-url https://github.com/kyledetella/typescript-ncc-serverless-template-direct --path <your_app> && cd <your_app>

Inside of your new app directory, run:

nvm use && npm i

Development

Install dependencies

nvm use && npm i

Testing locally

npm start

This will rebuild your project as you make changes. You can invoke your function(s) locally by:

serverless invoke local -f main

Run serverless invoke local --help for more options

Testing

npm t

To run in watch mode:

npm run test:watch

Deployment

npm run deploy