-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathmain.ts
More file actions
27 lines (21 loc) · 604 Bytes
/
main.ts
File metadata and controls
27 lines (21 loc) · 604 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Import this first
import './instrument';
// Import other modules
import { NestFactory } from '@nestjs/core';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
import { AppModule } from './app.module';
const PORT = 3030;
const MICROSERVICE_PORT = 3040;
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.connectMicroservice<MicroserviceOptions>({
transport: Transport.TCP,
options: {
host: '127.0.0.1',
port: MICROSERVICE_PORT,
},
});
await app.startAllMicroservices();
await app.listen(PORT);
}
bootstrap();