Skip to content

Commit

Permalink
update gateway module
Browse files Browse the repository at this point in the history
  • Loading branch information
Anas Abbal committed Jun 19, 2024
1 parent 420117e commit 2a5a8f8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 47 deletions.
22 changes: 0 additions & 22 deletions apps/gateway/src/gateway.controller.spec.ts

This file was deleted.

12 changes: 0 additions & 12 deletions apps/gateway/src/gateway.controller.ts

This file was deleted.

51 changes: 46 additions & 5 deletions apps/gateway/src/gateway.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,51 @@
import { Module } from '@nestjs/common';
import { GatewayController } from './gateway.controller';
import { GatewayService } from './gateway.service';
import { ClientsModule, Transport } from '@nestjs/microservices';
import { PrometheusModule } from '@willsoto/nestjs-prometheus';
import { ConfigModule } from '@nestjs/config';
import { WinstonModule } from 'nest-winston';
import * as winston from 'winston';
import { AuthController } from './rest/auth.controller';
import { UserController } from './rest/user.controller';
import { DriversController } from './rest/driver.controller';
import { UserService } from './services/user-service';
import { DriverService } from './services/driver-service';

@Module({
imports: [],
controllers: [GatewayController],
providers: [GatewayService],
imports: [
PrometheusModule.register({
path: '/metrics',
}),
ConfigModule.forRoot(),
ClientsModule.register([
{
name: 'USER_SERVICE',
transport: Transport.TCP,
options: {
host: 'localhost',
port: 3001, // port of user-service
},
},
{
name: 'DRIVER_SERVICE',
transport: Transport.TCP,
options: {
host: 'localhost',
port: 3002, // port of user-service
},
},
]),
WinstonModule.forRoot({
transports: [
new winston.transports.Console({
format: winston.format.combine(
winston.format.timestamp(),
winston.format.simple(),
),
})
],
}),
],
controllers: [AuthController, UserController, DriversController],
providers: [UserService, DriverService]
})
export class GatewayModule {}
8 changes: 0 additions & 8 deletions apps/gateway/src/gateway.service.ts

This file was deleted.

0 comments on commit 2a5a8f8

Please sign in to comment.