fix(api): control host with env var (#55439)

This commit is contained in:
Oliver Eyton-Williams
2024-07-08 14:39:18 +02:00
committed by GitHub
parent e8b15a255b
commit 5fcdfe0ec2
2 changed files with 4 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="./reset.d.ts" />
import { build } from './app';
import { FREECODECAMP_NODE_ENV, PORT } from './utils/env';
import { FREECODECAMP_NODE_ENV, HOST, PORT } from './utils/env';
const envToLogger = {
development: {
@@ -27,7 +27,7 @@ const start = async () => {
try {
const port = Number(PORT);
fastify.log.info(`Starting server on port ${port}`);
await fastify.listen({ port });
await fastify.listen({ port, host: HOST });
} catch (err) {
fastify.log.error(err);
process.exit(1);