feat: listen on both hkp and default port
This commit is contained in:
parent
50c243ab7c
commit
d3c2907ef7
14
src/main.ts
14
src/main.ts
|
@ -1,8 +1,5 @@
|
|||
import type {
|
||||
NestFastifyApplication} from '@nestjs/platform-fastify';
|
||||
import {
|
||||
FastifyAdapter
|
||||
} from '@nestjs/platform-fastify'
|
||||
import type { NestFastifyApplication } from '@nestjs/platform-fastify'
|
||||
import { FastifyAdapter } from '@nestjs/platform-fastify'
|
||||
import { NestFactory } from '@nestjs/core'
|
||||
import handlebars from 'hbs'
|
||||
|
||||
|
@ -10,7 +7,7 @@ import { join } from 'path'
|
|||
|
||||
import { AppModule } from './app.module.js'
|
||||
|
||||
async function bootstrap() {
|
||||
async function bootstrap(port: string | number) {
|
||||
const app = await NestFactory.create<NestFastifyApplication>(
|
||||
AppModule,
|
||||
new FastifyAdapter()
|
||||
|
@ -30,6 +27,7 @@ async function bootstrap() {
|
|||
templates: join(root, '..', 'views.dist'),
|
||||
})
|
||||
|
||||
await app.listen(3000)
|
||||
await app.listen(port)
|
||||
}
|
||||
bootstrap()
|
||||
bootstrap(11371)
|
||||
bootstrap(process.env.LISTEN_PORT ?? 8080)
|
Loading…
Reference in New Issue