App Host
The module that provides the access to the NestJS application instance.
Last updated
The module that provides the access to the NestJS application instance.
Last updated
To use this module, you need to import it at least once in your main module. This way, you can inject it into the remaining modules without having to import it again.
In the example below, I am importing the module and also the service.
Injecting the module into our service.
This module is global, you only need to import it once in the main module. After that, you can inject the service without importing it in the other modules.
But remember to include AppHostService in the list of providers for the module where you want to inject it.
You won't need to connect the pieces with any other module.
app
static
The NestJS application instance.
setApp
public
Set the NestJS application instance.
getHttpServer
public
Returns the underlying native HTTP server.
getHttpAdapter
public
Returns the underlying HTTP adapter.
getMicroservices
public
Returns array of the microservices connected to the NestApplication.
getUrl
public
Returns the url the application is listening at, based on OS and IP version. Returns as an IP value either in IPv6 or IPv4