feat: listen on both hkp and default port

This commit is contained in:
b1ek 2024-07-28 14:53:20 +10:00
parent 50c243ab7c
commit d3c2907ef7
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 6 additions and 8 deletions

View File

@ -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)