Skip to content

Sample Project to set up dynamoose in nest.js

Notifications You must be signed in to change notification settings

geekmini/nestjs-dynamoose-sample

Repository files navigation

Nest.js Dynamoose Sample

Install and Run

npm install
docker-compose up -d
npm run start:dev

Dashboard for Local DynamoDB

npm run db:local

Get Access to Context Object

It's free to inject the Context object into any layer (controller, service or repo layer). Developer can use this feature for contextual logging. You can also customize the Context generation logic in src/common/context/context.ts

export class SomeController {
    @Inject()
    context: Context
}

Add Environment Variables

  • add in .env.local
  • set default value in src/providers/config/derive.ts
  • set derived values in src/providers/config/derive.ts
  • add type and validation rules in src/providers/config/envs.ts

Get Environment Variables

const port = config.get<string>("PORT")
// not recommended, only for rare cases
process.env.PORT

About

Sample Project to set up dynamoose in nest.js

Resources

Stars

Watchers

Forks