UNPKG

986 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3/**
4 * Defines the `HttpAdapterHost` object.
5 *
6 * `HttpAdapterHost` wraps the underlying
7 * platform-specific `HttpAdapter`. The `HttpAdapter` is a wrapper around the underlying
8 * native HTTP server library (e.g., Express). The `HttpAdapterHost` object
9 * provides methods to `get` and `set` the underlying HttpAdapter.
10 *
11 * @see [Http adapter](https://docs.nestjs.com/faq/http-adapter)
12 *
13 * @publicApi
14 */
15class HttpAdapterHost {
16 /**
17 * Accessor for the underlying `HttpAdapter`
18 *
19 * @param httpAdapter reference to the `HttpAdapter` to be set
20 */
21 set httpAdapter(httpAdapter) {
22 this._httpAdapter = httpAdapter;
23 }
24 /**
25 * Accessor for the underlying `HttpAdapter`
26 *
27 * @example
28 * `const httpAdapter = adapterHost.httpAdapter;`
29 */
30 get httpAdapter() {
31 return this._httpAdapter;
32 }
33}
34exports.HttpAdapterHost = HttpAdapterHost;