Created
April 24, 2019 13:35
-
-
Save martijnvdbrug/12faf0fe0e1fc512c2a73fba9f31ca53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable, Module} from '@nestjs/common'; | |
import {NestFactory} from '@nestjs/core'; | |
@Injectable() | |
export class SlowService { | |
constructor() { | |
console.log(`Created SlowService`); | |
} | |
} | |
@Injectable() | |
export class DbService { | |
constructor() { | |
console.log(`Created DbService`); | |
} | |
} | |
@Module({ | |
imports: [], | |
providers: [SlowService, DbService], | |
exports: [SlowService, DbService] | |
}) | |
export class BaseModule {} | |
@Module({ | |
imports: [], | |
providers: [DbService], | |
}) | |
export class OtherModule {} | |
@Module({ | |
imports: [ | |
BaseModule, | |
OtherModule | |
], | |
}) | |
export class AppModule {} | |
NestFactory.createApplicationContext(AppModule).then((app) => console.log('🥑 context created')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment