From c304effcdf80946203db76a0b5e22f6b1e0b17dd Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Fri, 8 Nov 2024 12:03:08 -0500 Subject: [PATCH] fix: externalize process.env --- server.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server.mjs b/server.mjs index bcf6401..79d28b8 100755 --- a/server.mjs +++ b/server.mjs @@ -8,6 +8,7 @@ import { access, constants } from 'node:fs/promises' import { createReadStream, existsSync, statSync } from 'node:fs' import { createServer } from 'node:http' import { join, resolve } from 'node:path' +import { env } from 'node:process' function log(level, message) { const date = new Date().toISOString() @@ -42,9 +43,9 @@ const { } = await import('@remix-run/node') const { default: mime } = await import('mime') -const port = process.env.PORT || 3000 -const host = process.env.HOST || '0.0.0.0' -const buildPath = process.env.BUILD_PATH || './build' +const port = env.PORT || 3000 +const host = env.HOST || '0.0.0.0' +const buildPath = env.BUILD_PATH || './build' // Because this is a dynamic import without an easily discernable path // we gain the "deoptimization" we want so that Vite doesn't bundle this