NestJS materials

Write an awesome doc for NestJS tips, tricks, notes, things which are not in the doc (or are but not really obvious) and experimented to figure them out and use them.

View on GitHub

DTOs

With class-transformeer we can rename a field like this:

class Person {
  @Expose({name: 'age_of_user' })
  age: number
}

Now we can invoke the API with this: { age_of_user: 13 } but in your code you can access it like: pperson.age instead of person.age_of_user.