Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
LoggerFactory,
MQHealthIndicator,
RedisHealthIndicator,
TerminusOptionsService,
WSModule,
} from '.';
const logger = LoggerFactory.getLogger('ApplicationModule');
@Module({
imports: [
TypeOrmModule.forRoot(),
AdminInternalModule,
GraphqlModule.forRoot(__dirname),
WSModule,
TerminusModule.forRootAsync({
useClass: TerminusOptionsService.withHealthIndicators(
async () => new RedisHealthIndicator().isHealthy('redis'),
async () => new MQHealthIndicator().isHealthy('mq'),
),
}),
],
controllers: [],
})
export class ApplicationModule implements OnModuleInit {
public onModuleInit(): void {
logger.log('init...');
}
}
const pkg = require('../package.json');
import * as services from './services';
import * as clients from './clients';
import { LoggerModule } from '@nestcloud/logger';
@Module({
imports: [
LoggerModule.register(),
ScheduleModule.register(),
BootModule.register(__dirname, `bootstrap-${process.env.NODE_ENV || 'development'}.yml`),
ConsulModule.register({ dependencies: [NEST_BOOT] }),
ConfigModule.register({ dependencies: [NEST_BOOT, NEST_CONSUL] }),
ServiceModule.register({ dependencies: [NEST_BOOT, NEST_CONSUL] }),
LoadbalanceModule.register({ dependencies: [NEST_BOOT] }),
FeignModule.register({ dependencies: [NEST_LOADBALANCE] }),
ProxyModule.register({ dependencies: [NEST_BOOT] }),
TerminusModule.forRootAsync({
inject: [TypeOrmHealthIndicator],
useFactory: () => ({ endpoints: [{ url: '/health', healthIndicators: [] }] }),
}),
],
controllers: components(controllers),
providers: components(services, clients),
})
export class AppModule {
}
import { Module } from '@nestjs/common';
import { TerminusModule } from '@nestjs/terminus';
import { TerminusOptionsService } from './terminus-options.service';
@Module({
imports: [
TerminusModule.forRootAsync({
useClass: TerminusOptionsService,
}),
],
})
export class HealthModule {}
}),
async () =>
microservice.pingCheck('redis', {
transport: Transport.REDIS,
options: {
url: 'redis://localhost:6379',
},
}),
],
},
],
});
@Module({
imports: [
TerminusModule.forRootAsync({
inject: [MicroserviceHealthIndicator],
useFactory: getTerminusOptions,
}),
],
})
export class HealthModule {}
buildSchemaOptions: {
orphanedTypes: [Plan],
},
playground: {
workspaceName: 'GRAPHQL SERVICE PLAN',
settings: {
'editor.theme': 'light',
},
},
context: ({ req, res }) => buildContext({ req, res }),
}),
CoreModule,
StripeModule.forRoot({
apiKey: AppConfig.payment?.stripe?.secretKey,
}),
TerminusModule.forRootAsync({
imports: [AppModule],
useClass: HealthOptionsService,
}),
BillingModule,
PlanModule,
CardModule,
InvoiceModule,
SubscriptionModule,
],
controllers: [AppController],
providers: [
AppService,
MongoHealthIndicator,
],
exports: [MongoHealthIndicator],
})
import { OracleDbHealthIndicator } from '../../db/database.health';
const getTerminusOptions = (db: OracleDbHealthIndicator ): TerminusModuleOptions => ({
endpoints: [
{
url: '/health',
healthIndicators: [
async () => db.pingCheck('database', { timeout: 1e3 }),
],
},
],
});
@Module({
imports: [
TerminusModule.forRootAsync({
imports: [DatabaseModule],
inject: [OracleDbHealthIndicator],
useFactory: db => getTerminusOptions(db),
}),
],
})
export class HealthModule { }
import { ConsulConfigModule } from '@nestcloud/consul-config';
import { ConsulServiceModule } from '@nestcloud/consul-service';
import { NEST_BOOT, NEST_CONSUL_CONFIG } from '@nestcloud/common';
import { TerminusModule } from '@nestjs/terminus';
import { GatewayModule } from '@nestcloud/gateway';
import { ApiController } from "./api.controller";
import { GatewayService } from "./gateway.service";
@Module({
imports: [
BootModule.register(__dirname, `config.yaml`),
ConsulModule.register({ dependencies: [NEST_BOOT] }),
ConsulConfigModule.register({ dependencies: [NEST_BOOT] }),
ConsulServiceModule.register({ dependencies: [NEST_BOOT] }),
GatewayModule.register({ dependencies: [NEST_CONSUL_CONFIG] }),
TerminusModule.forRootAsync({
useFactory: () => ({ endpoints: [{ url: '/health', healthIndicators: [] }] }),
}),
],
controllers: [ApiController],
providers: [GatewayService]
})
export class AppModule {
}
import { SpellModule } from './spell/spell.module';
@Module({
imports: [
ConfigModule.forRootAsync(ConfigModule, {
useClass: ConfigModuleConfig,
}),
DatabaseModule.forRootAsync({
imports: [ConfigModule.Deferred],
useClass: DatabaseModuleConfig,
}),
GraphQLModule.forRootAsync({
imports: [ConfigModule.Deferred],
useClass: GraphQLModuleConfig,
}),
TerminusModule.forRootAsync({
useClass: TerminusOptionsService,
}),
OgmaModule.forRootAsync({
useClass: OgmaModuleConfig,
imports: [ConfigModule.Deferred],
}),
AuthModule,
CharacterModule,
AbilityScoreModule,
SpellModule,
],
providers: [AppService, AppResolver],
})
export class AppModule {}
import { Module } from '@nestjs/common';
import { BootModule } from '@nestcloud/boot';
import { ConsulModule } from '@nestcloud/consul';
import { ConsulServiceModule } from '@nestcloud/consul-service';
import { NEST_BOOT } from '@nestcloud/common';
import { TerminusModule } from '@nestjs/terminus';
import { GatewayModule } from '@nestcloud/gateway';
import { ApiController } from "./api.controller";
@Module({
imports: [
BootModule.register(__dirname, `config.yaml`),
ConsulModule.register({ dependencies: [NEST_BOOT] }),
ConsulServiceModule.register({ dependencies: [NEST_BOOT] }),
GatewayModule.register({ dependencies: [NEST_BOOT] }),
TerminusModule.forRootAsync({
useFactory: () => ({ endpoints: [{ url: '/health', healthIndicators: [] }] }),
}),
],
controllers: [ApiController]
})
export class AppModule {
}
import { Module } from '@nestjs/common';
import { TerminusModule } from '@nestjs/terminus';
import { TerminusOptionsService } from './terminus-options.service';
@Module({
imports: [
TerminusModule.forRootAsync({
useClass: TerminusOptionsService,
}),
],
})
export class HealthModule {}