Custom providers in nest JS consist of dependency injection.
Dependency injection is an inversion of control (IoC) technique wherein you delegate instantiation of dependencies to the IoC container, instead of doing it in your own code imperatively.
Standard providers
The providers property takes an array of providers. So far, we've supplied those providers via a list of class names. In fact, the syntax providers: [UsersService] is short-hand for the more complete syntax.
Now that we see this explicit construction, we can understand the registration process. Here, we are clearly associating the token UsersService with the class UsersService. The short-hand notation is merely a convenience to simplify the most common use-case where the token is used to request an instance of a class by the same name.
Custom providers
What happens when our requirements go beyond those offered by Standard providers? Here are a few examples:
Value providers: useValue
The useValue syntax is useful for injecting a constant value, putting an external library into the Nest container or replacing a real implementation with a mock object.
Serverless in Nest JS Serverless computing is a cloud computing execution model in which the cloud provider allocates machine resources on-demand, taking care of the servers on behalf of their customers. When an app is not in use, there are no computing resources allocated to the app. Pricing is based on the actual amount of resources consumed by application
Custom route decorators Nest is built around a language feature called decorators. Decorators are a well-known concept in a lot of commonly used programming languages but in the JavaScript world they're still relatively new.