Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.16 KB

README.md

File metadata and controls

45 lines (35 loc) · 1.16 KB

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