Skip to content
/ nestsls-template Public template

This is a sample project template to demonstrate how to use NestJS with Serverless Framework and Create a Rest API with using AWS Lambda. This project is using NestJS with Serverless Framework and AWS Lambda.

License

Notifications You must be signed in to change notification settings

andrewdex/nestsls-template

Repository files navigation

NestJS + Serverless Rest API with AWS Lambda - Template

Description

This is a sample project template to demonstrate how to use NestJS with Serverless Framework and Create a Rest API with using AWS Lambda. This project is using NestJS with Serverless Framework and AWS Lambda.

Installation

$ npm install

Install SLS globally

$ npm install -g serverless

Running the app with SLS offline

# development
$ npm run start:offline

Access the Root API Route

# development
$ http://localhost:3000/dev/api

Access the sample posts API Route

# development
$ http://localhost:3000/dev/api/posts

Deploy the app with SLS

WARNING!: Remember you have to have AWS CLI installed and configured with your AWS account, before you deploy the app. It's recommended to use an IAM user with admin access to deploy the app (with provisioning the least needed privileges).

Under the hood of the NPM command this uses the following SLS command

sls deploy --aws-profile <your-aws-profile-name>

Run it using NPM Scripts use the following command

# development
$ npm run deploy-lambda

Running the app with Nest

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Stay in touch

License

MIT licensed.

About

This is a sample project template to demonstrate how to use NestJS with Serverless Framework and Create a Rest API with using AWS Lambda. This project is using NestJS with Serverless Framework and AWS Lambda.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published