|
1 | 1 | import { Module } from '@nestjs/common';
|
2 | 2 | import { GraphQLModule } from '@nestjs/graphql';
|
3 | 3 | import { join } from 'path';
|
4 |
| -import { UserModule } from './user/user.module'; |
5 | 4 | import { TypeOrmModule } from '@nestjs/typeorm';
|
6 | 5 | import { ConfigModule, ConfigService } from '@nestjs/config';
|
7 | 6 | import configuration from './config/configuration';
|
8 |
| -import { Context } from 'vm'; |
9 |
| -import { JwtAuthGuard } from './auth/auth.guard'; |
10 |
| -import { APP_GUARD } from '@nestjs/core'; |
11 |
| -import { JwtStrategy } from './auth/jwt.strategy'; |
12 |
| -import { ItemModule } from './item/item.module'; |
13 | 7 | import * as Joi from 'joi';
|
14 |
| -import { FileModule } from './file/file.module'; |
15 |
| -import { RolesGuard } from './auth/roles.guard'; |
| 8 | +import { floxModules, floxProviders } from './flox/flox'; |
16 | 9 |
|
17 | 10 | @Module({
|
18 | 11 | imports: [
|
19 | 12 | GraphQLModule.forRoot({
|
20 | 13 | playground: true,
|
21 |
| - //services: [ApolloServerPluginLandingPageLocalDefault()], // Use Apollo Sandbox instead of graphql-playground |
22 | 14 | debug: true,
|
23 | 15 | autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
|
24 | 16 | sortSchema: true,
|
25 |
| - //disableHealthCheck: true //set true if using multiple GraphQL endpoints in a single application with fastify |
26 |
| - installSubscriptionHandlers: true, |
27 |
| - subscriptions: { |
28 |
| - // Could also use graphql-ws instead of default (subscriptions-transport-ws) |
29 |
| - 'subscriptions-transport-ws': { |
30 |
| - path: '/graphql-websocket', |
31 |
| - onConnect: (context: Context) => { |
32 |
| - console.log('Client connected to GraphQL Websocket!', context); |
33 |
| - }, |
34 |
| - }, |
35 |
| - }, |
36 | 17 | }),
|
37 | 18 | ConfigModule.forRoot({
|
38 | 19 | isGlobal: true,
|
@@ -71,20 +52,23 @@ import { RolesGuard } from './auth/roles.guard';
|
71 | 52 | }),
|
72 | 53 | inject: [ConfigService],
|
73 | 54 | }),
|
74 |
| - UserModule, |
75 |
| - ItemModule, |
76 |
| - FileModule, |
| 55 | + // TypeOrmModule.forFeature([ TODO check if needed |
| 56 | + // // Entities for Flox modules |
| 57 | + // ...floxEntities(), |
| 58 | + // // Add any custom entities here |
| 59 | + // ]), |
| 60 | + // Flox modules |
| 61 | + ...floxModules(), |
| 62 | + // Add any custom modules here |
77 | 63 | ],
|
78 | 64 | providers: [
|
79 |
| - JwtStrategy, |
80 |
| - { |
81 |
| - provide: APP_GUARD, |
82 |
| - useClass: JwtAuthGuard, |
83 |
| - }, |
84 |
| - { |
85 |
| - provide: APP_GUARD, |
86 |
| - useClass: RolesGuard, |
87 |
| - }, |
| 65 | + // Flox module Providers |
| 66 | + ...floxProviders(), |
| 67 | + // Add any other custom module providers here |
88 | 68 | ],
|
89 | 69 | })
|
| 70 | + |
| 71 | +/** |
| 72 | + * Main Module |
| 73 | + */ |
90 | 74 | export class AppModule {}
|
0 commit comments