Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martijnvdbrug/12faf0fe0e1fc512c2a73fba9f31ca53 to your computer and use it in GitHub Desktop.
Save martijnvdbrug/12faf0fe0e1fc512c2a73fba9f31ca53 to your computer and use it in GitHub Desktop.
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