Skip to content

Instantly share code, notes, and snippets.

@iampeterbanjo
Created September 2, 2019 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iampeterbanjo/18539ee99e4cbf826cf4f7e239bfc98b to your computer and use it in GitHub Desktop.
Save iampeterbanjo/18539ee99e4cbf826cf4f7e239bfc98b to your computer and use it in GitHub Desktop.
NestJS notes

NestJS notes

In a larger application, it makes sense to organize your application into multiple modules that split up your code into features and related capabilities.

To define a module, you have to register all of the

  • Services that will be instantiated by the Nest.js injector as Providers
  • Controllers that will require the Providers as Controllers
  • Controllers exported by another module as imports

Providers can be injected into:

  • Controllers
  • other Providers

The root module in our application doesn’t need to have any exports since no other modules import it. Modules are singletons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment