-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anas Abbal
committed
Jun 19, 2024
1 parent
420117e
commit 2a5a8f8
Showing
4 changed files
with
46 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} |
This file was deleted.
Oops, something went wrong.