Skip to content

Commit 733dea9

Browse files
authored
chore: Use unique ports. (#790)
1 parent 99650c9 commit 733dea9

File tree

6 files changed

+59
-59
lines changed

6 files changed

+59
-59
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import { Module } from '@nestjs/common';
2-
import { HeroController } from './hero.controller';
3-
import { ClientsModule, Transport } from '@nestjs/microservices';
4-
import { join } from 'path';
5-
import { HERO_PACKAGE_NAME } from '../hero';
1+
import { Module } from "@nestjs/common";
2+
import { HeroController } from "./hero.controller";
3+
import { ClientsModule, Transport } from "@nestjs/microservices";
4+
import { join } from "path";
5+
import { HERO_PACKAGE_NAME } from "../hero";
66

77
@Module({
88
imports: [
99
ClientsModule.register([
10-
{
11-
name: HERO_PACKAGE_NAME,
12-
transport: Transport.GRPC,
13-
options: {
14-
url: '0.0.0.0:8081',
15-
package: HERO_PACKAGE_NAME,
16-
protoPath: join(__dirname, '../hero.proto'),
17-
},
10+
{
11+
name: HERO_PACKAGE_NAME,
12+
transport: Transport.GRPC,
13+
options: {
14+
url: "0.0.0.0:8082",
15+
package: HERO_PACKAGE_NAME,
16+
protoPath: join(__dirname, "../hero.proto"),
1817
},
18+
},
1919
]),
2020
],
21-
controllers: [HeroController]
21+
controllers: [HeroController],
2222
})
23-
export class AppModule {}
23+
export class AppModule {}
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { NestFactory } from '@nestjs/core';
2-
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
3-
import { join } from 'path';
4-
import { AppModule } from './app.module';
5-
import { HERO_PACKAGE_NAME } from '../hero';
1+
import { NestFactory } from "@nestjs/core";
2+
import { MicroserviceOptions, Transport } from "@nestjs/microservices";
3+
import { join } from "path";
4+
import { AppModule } from "./app.module";
5+
import { HERO_PACKAGE_NAME } from "../hero";
66

77
export async function createApp() {
8-
const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
9-
transport: Transport.GRPC,
10-
options: {
11-
url: '0.0.0.0:8081',
12-
package: HERO_PACKAGE_NAME,
13-
protoPath: join(__dirname, '../hero.proto'),
14-
},
15-
});
16-
17-
return app;
18-
}
8+
const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
9+
transport: Transport.GRPC,
10+
options: {
11+
url: "0.0.0.0:8082",
12+
package: HERO_PACKAGE_NAME,
13+
protoPath: join(__dirname, "../hero.proto"),
14+
},
15+
});
16+
17+
return app;
18+
}

integration/nestjs-simple-usedate/nestjs-project/app.module.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Module } from '@nestjs/common';
2-
import { ClientsModule, Transport } from '@nestjs/microservices';
3-
import { join } from 'path';
4-
import { HERO_PACKAGE_NAME } from '../hero';
5-
import { HeroController } from './hero.controller';
1+
import { Module } from "@nestjs/common";
2+
import { ClientsModule, Transport } from "@nestjs/microservices";
3+
import { join } from "path";
4+
import { HERO_PACKAGE_NAME } from "../hero";
5+
import { HeroController } from "./hero.controller";
66

77
@Module({
88
imports: [
@@ -11,9 +11,9 @@ import { HeroController } from './hero.controller';
1111
name: HERO_PACKAGE_NAME,
1212
transport: Transport.GRPC,
1313
options: {
14-
url: '0.0.0.0:8080',
14+
url: "0.0.0.0:8083",
1515
package: HERO_PACKAGE_NAME,
16-
protoPath: join(__dirname, '../hero.proto'),
16+
protoPath: join(__dirname, "../hero.proto"),
1717
loader: {
1818
longs: Number,
1919
},

integration/nestjs-simple-usedate/nestjs-project/main.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { NestFactory } from '@nestjs/core';
2-
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
3-
import { join } from 'path';
4-
import { HERO_PACKAGE_NAME } from '../hero';
5-
import { AppModule } from './app.module';
1+
import { NestFactory } from "@nestjs/core";
2+
import { MicroserviceOptions, Transport } from "@nestjs/microservices";
3+
import { join } from "path";
4+
import { HERO_PACKAGE_NAME } from "../hero";
5+
import { AppModule } from "./app.module";
66

77
export async function createApp() {
88
const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
99
transport: Transport.GRPC,
1010
options: {
11-
url: '0.0.0.0:8080',
11+
url: "0.0.0.0:8083",
1212
package: HERO_PACKAGE_NAME,
13-
protoPath: join(__dirname, '../hero.proto'),
13+
protoPath: join(__dirname, "../hero.proto"),
1414
loader: {
1515
longs: Number,
1616
},

integration/nestjs-simple/nestjs-project/app.module.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Module } from '@nestjs/common';
2-
import { ClientsModule, Transport } from '@nestjs/microservices';
3-
import { join } from 'path';
4-
import { HERO_PACKAGE_NAME } from '../hero';
5-
import { HeroController } from './hero.controller';
1+
import { Module } from "@nestjs/common";
2+
import { ClientsModule, Transport } from "@nestjs/microservices";
3+
import { join } from "path";
4+
import { HERO_PACKAGE_NAME } from "../hero";
5+
import { HeroController } from "./hero.controller";
66

77
@Module({
88
imports: [
@@ -11,9 +11,9 @@ import { HeroController } from './hero.controller';
1111
name: HERO_PACKAGE_NAME,
1212
transport: Transport.GRPC,
1313
options: {
14-
url: '0.0.0.0:8080',
14+
url: "0.0.0.0:8086",
1515
package: HERO_PACKAGE_NAME,
16-
protoPath: join(__dirname, '../hero.proto'),
16+
protoPath: join(__dirname, "../hero.proto"),
1717
loader: {
1818
longs: Number,
1919
},

integration/nestjs-simple/nestjs-project/main.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { NestFactory } from '@nestjs/core';
2-
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
3-
import { join } from 'path';
4-
import { HERO_PACKAGE_NAME } from '../hero';
5-
import { AppModule } from './app.module';
1+
import { NestFactory } from "@nestjs/core";
2+
import { MicroserviceOptions, Transport } from "@nestjs/microservices";
3+
import { join } from "path";
4+
import { HERO_PACKAGE_NAME } from "../hero";
5+
import { AppModule } from "./app.module";
66

77
export async function createApp() {
88
const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
99
transport: Transport.GRPC,
1010
options: {
11-
url: '0.0.0.0:8080',
11+
url: "0.0.0.0:8086",
1212
package: HERO_PACKAGE_NAME,
13-
protoPath: join(__dirname, '../hero.proto'),
13+
protoPath: join(__dirname, "../hero.proto"),
1414
loader: {
1515
longs: Number,
1616
},

0 commit comments

Comments
 (0)