Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { authenticate } from 'passport';
// Strategies
import { LocalStrategy } from './passport/local.strategy';
import { JwtStrategy } from './passport/jwt.strategy';
import { FacebookStrategy } from './passport/facebook.strategy';
import { TwitterStrategy } from './passport/twitter.strategy';
import { GoogleStrategy } from './passport/google-plus.strategy';
import { UserModule } from '../user/user.module';
import { authProviders } from './auth.providers';
import { AuthService } from './auth.service';
import { AuthController } from './auth.controller';
import { bodyValidatorMiddleware } from './middlewares/body-validator.middleware';
@Module({
imports: [UserModule],
providers: [
...authProviders,
AuthService,
LocalStrategy,
JwtStrategy,
FacebookStrategy,
TwitterStrategy,
GoogleStrategy
],
controllers: [AuthController]
})
export class AuthModule implements NestModule {
public configure(consumer: MiddlewareConsumer) {
consumer
.apply(
import { Module, HttpModule, forwardRef } from "@nestjs/common";
import { SpotifyService } from "./spotify.service";
import { UserModule } from "../user/user.module";
@Module({
imports: [
HttpModule,
forwardRef(() => UserModule)
],
providers: [
SpotifyService
],
exports: [
SpotifyService
]
})
export class SpotifyModule { }
import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { GraphqlOptions } from './graphql.options';
import { PostsModule } from './posts/posts.module';
import { PrismaModule } from './prisma/prisma.module';
@Module({
imports: [
GraphQLModule.forRootAsync({
useClass: GraphqlOptions,
}),
PrismaModule,
PostsModule,
],
})
export class AppModule {}
* -----
* File Created: 2019-08-23 19:02:24, Fri
* Author: Jooger (iamjooger@gmail.com)
* -----
* Last Modified: Monday, 26th August 2019 10:05:10 am
* Modified By: Jooger (iamjooger@gmail.com>)
* HISTORY:
* Date By Comments
* ---------- --- ---------------------------------------------------------
*/
import { Module } from '@nestjs/common'
import { VarModule } from '../var/var.module'
import { TypeormService } from './typeorm.service'
@Module({
imports: [VarModule],
providers: [TypeormService]
})
export class TypeormModule {}
Module,
MiddlewaresConsumer,
NestModule,
RequestMethod,
} from '@nestjs/common';
import { graphqlExpress, graphiqlExpress } from 'apollo-server-express';
import {
makeExecutableSchema,
addMockFunctionsToSchema,
mergeSchemas,
} from 'graphql-tools';
import { GraphQLModule, GraphQLFactory } from '@nestjs/graphql';
import { CatsModule } from './cats/cats.module';
@Module({
modules: [CatsModule, GraphQLModule],
})
export class ApplicationModule {
constructor(private readonly graphQLFactory: GraphQLFactory) {}
configure(consumer: MiddlewaresConsumer) {
const schema = this.createSchema();
consumer
.apply(graphiqlExpress({ endpointURL: '/graphql' }))
.forRoutes({ path: '/graphiql', method: RequestMethod.GET })
.apply(graphqlExpress(req => ({ schema, rootValue: req })))
.forRoutes({ path: '/graphql', method: RequestMethod.ALL });
}
createSchema() {
const typeDefs = this.graphQLFactory.mergeTypesByPaths('./**/*.graphql');
import { Module, DynamicModule, Global } from '@nestjs/common';
import { NEST_SCHEDULE_PROVIDER } from './constants';
import { Schedule } from './schedule';
import { IGlobalConfig } from './interfaces/global-config.interface';
@Global()
@Module({})
export class ScheduleModule {
static register(globalConfig?: IGlobalConfig): DynamicModule {
const scheduleProvider = {
provide: NEST_SCHEDULE_PROVIDER,
useFactory: (): Schedule => {
return new Schedule(globalConfig);
},
};
return {
module: ScheduleModule,
providers: [scheduleProvider],
exports: [scheduleProvider],
};
}
}
import { Module } from '@nestjs/common';
import { CatsController } from './cats.controller';
import { CatsService } from './cats.service';
@Module({
controllers: [CatsController],
components: [CatsService],
})
export class CatsModule {}
import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { CatsController } from './cats.controller';
import { CatsService } from './cats.service';
import { CatSchema } from './schemas/cat.schema';
@Module({
imports: [MongooseModule.forFeature([{ name: 'Cat', schema: CatSchema }])],
controllers: [CatsController],
providers: [CatsService],
})
export class CatsModule {}
import { Module } from '@nestjs/common';
import { CatsModule } from './cats/cats.module';
@Module({
imports: [CatsModule],
})
export class AppModule {}
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthModule } from '../../../src/auth/auth.module';
import { DraftModule } from '../../../src/crud/draft/draft.module';
import { PubSubProvider } from '../../../src/crud/providers/pubSub.provider';
import { FileStorageModule } from '../../../src/fileStorage/fileStorage.module';
import { TenantController } from './tenant.controller';
import { Tenant } from './tenant.entity';
import { TenantMapper } from './tenant.mapper';
import { TenantResolver } from './tenant.resolver';
import { TenantService } from './tenant.service';
@Module({
imports: [TypeOrmModule.forFeature([Tenant]), FileStorageModule, DraftModule, AuthModule],
providers: [TenantService, TenantResolver, TenantMapper, PubSubProvider],
controllers: [TenantController],
exports: [TenantService],
})
export class TenantModule {}