Skip to content

Template of a simple serverless typescript api service with dynamodb

License

Notifications You must be signed in to change notification settings

TheSmartMonkey/create-serverless-simple-ts-service

Repository files navigation

Serverless simple typescript service template

Template of a simple serverless typescript api service with dynamodb

Installation

npx degit https://github.com/TheSmartMonkey/create-serverless-simple-ts-service serverless-ts-service

Changes to be done

  1. package.json config name

  2. serverless.ts service name

  3. Change the region in serverless.ts provider/region (current region: Paris)

Getting started

  1. Install serverless framework : serverless framework Get Started

  2. Setup your aws credentials : aws config

Create a cloud formation stack on aws : npm run deploy

Remove a cloud formation stack on aws : npm run undeploy

Manual test locally

In order to test the lambda functions locally, after you have deployed the stack a first times for dependencies like dynamodb, run the following command:

  • npx sls invoke local -f hello --path src/functions/hello/mock.json

Check the sls invoke local command documentation for more information.

To simulate remote locally

In serverless.ts put environment/OFFLINE to 'true'

Then run npm run offline

Your sls invoke local commands now target your offline stack

About

Template of a simple serverless typescript api service with dynamodb

Topics

Resources

License

Stars

Watchers

Forks