import { Global, Module } from '@nestjs/common'; import { ScheduleModule } from '@nestjs/schedule'; import { SyncService } from './sync.service'; import { SyncController } from './sync.controller'; import { SyncSchedulerService } from './sync-scheduler.service'; /// Global so every feature module can inject SyncService to capture its /// mutations without each one importing SyncModule explicitly. @Global() @Module({ imports: [ScheduleModule.forRoot()], controllers: [SyncController], providers: [SyncService, SyncSchedulerService], exports: [SyncService], }) export class SyncModule {}