1 | "use strict";
|
2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7 | };
|
8 | var HttpModule_1;
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | const common_1 = require("@nestjs/common");
|
11 | const http_service_1 = require("./http.service");
|
12 | const http_provider_1 = require("./http.provider");
|
13 | let HttpModule = HttpModule_1 = class HttpModule {
|
14 | static forRoot(options) {
|
15 | const optionsProvider = http_provider_1.createHttpOptionsProvider(options);
|
16 | const providers = [http_service_1.HttpFetchService, optionsProvider];
|
17 | return {
|
18 | module: HttpModule_1,
|
19 | imports: [common_1.HttpModule],
|
20 | providers,
|
21 | exports: providers,
|
22 | };
|
23 | }
|
24 | static forRootAsync(options) {
|
25 | const optionsProvider = http_provider_1.createHttpAsyncOptionsProvider(options);
|
26 | const providers = [http_service_1.HttpFetchService, optionsProvider];
|
27 | return {
|
28 | module: HttpModule_1,
|
29 | imports: [common_1.HttpModule],
|
30 | providers,
|
31 | exports: providers,
|
32 | };
|
33 | }
|
34 | };
|
35 | HttpModule = HttpModule_1 = __decorate([
|
36 | common_1.Global(),
|
37 | common_1.Module({})
|
38 | ], HttpModule);
|
39 | exports.HttpModule = HttpModule;
|
40 |
|
\ | No newline at end of file |