diff --git a/apps/api/src/config/schema/env.ts b/apps/api/src/config/schema/env.ts index 416e990..c8a80de 100644 --- a/apps/api/src/config/schema/env.ts +++ b/apps/api/src/config/schema/env.ts @@ -5,6 +5,10 @@ const envSchema = z.object({ .string() .transform((val) => Number.parseInt(val, 10)) .default('900'), + PORT: z + .string() + .transform((val) => Number.parseInt(val, 10)) + .default('3001'), REDIS_HOST: z.string(), REDIS_PORT: z .string() diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 43efeb9..1f8c772 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -1,4 +1,5 @@ import { AppModule } from './app.module'; +import { env } from './config/env'; import { NestFactory } from '@nestjs/core'; import type { NestFastifyApplication } from '@nestjs/platform-fastify'; import { FastifyAdapter } from '@nestjs/platform-fastify'; @@ -8,6 +9,7 @@ async function bootstrap() { AppModule, new FastifyAdapter(), ); - await app.listen(3001); + + await app.listen(env.PORT, '0.0.0.0'); } bootstrap();