Skip to content

Commit

Permalink
debugging hbs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
enochval committed Jun 17, 2024
1 parent 64630fc commit 4a336cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Module } from '@nestjs/common';
import { MiddlewareConsumer, Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { GraphQLModule } from '@nestjs/graphql';
Expand All @@ -11,6 +11,7 @@ import { AlbumsModule } from './modules/albums/albums.module';
import { TodosModule } from './modules/todos/todos.module';
import { JsonplaceholderModule } from './common/services/jsonplaceholder/jsonplaceholder.module';
import configuration from './config/configuration';
import { graphqlMiddleware } from './common/middlewares/graphql.middleware';

@Module({
imports: [
Expand All @@ -37,4 +38,10 @@ import configuration from './config/configuration';
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
export class AppModule {
configure(consumer: MiddlewareConsumer) {
consumer
.apply(graphqlMiddleware)
.forRoutes('graphql')
}
}
3 changes: 1 addition & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ async function bootstrap() {
app.useStaticAssets(join(__dirname, '..', 'public'));
app.setBaseViewsDir(join(__dirname, '..', 'views'));
app.setViewEngine('hbs');

app.use(graphqlMiddleware)

await app.listen(3000);
}
bootstrap();

0 comments on commit 4a336cd

Please sign in to comment.