mirror of
https://github.com/tale/headplane.git
synced 2026-08-30 08:49:30 +00:00
fix: externalize process.env
This commit is contained in:
+4
-3
@@ -8,6 +8,7 @@ import { access, constants } from 'node:fs/promises'
|
|||||||
import { createReadStream, existsSync, statSync } from 'node:fs'
|
import { createReadStream, existsSync, statSync } from 'node:fs'
|
||||||
import { createServer } from 'node:http'
|
import { createServer } from 'node:http'
|
||||||
import { join, resolve } from 'node:path'
|
import { join, resolve } from 'node:path'
|
||||||
|
import { env } from 'node:process'
|
||||||
|
|
||||||
function log(level, message) {
|
function log(level, message) {
|
||||||
const date = new Date().toISOString()
|
const date = new Date().toISOString()
|
||||||
@@ -42,9 +43,9 @@ const {
|
|||||||
} = await import('@remix-run/node')
|
} = await import('@remix-run/node')
|
||||||
const { default: mime } = await import('mime')
|
const { default: mime } = await import('mime')
|
||||||
|
|
||||||
const port = process.env.PORT || 3000
|
const port = env.PORT || 3000
|
||||||
const host = process.env.HOST || '0.0.0.0'
|
const host = env.HOST || '0.0.0.0'
|
||||||
const buildPath = process.env.BUILD_PATH || './build'
|
const buildPath = env.BUILD_PATH || './build'
|
||||||
|
|
||||||
// Because this is a dynamic import without an easily discernable path
|
// Because this is a dynamic import without an easily discernable path
|
||||||
// we gain the "deoptimization" we want so that Vite doesn't bundle this
|
// we gain the "deoptimization" we want so that Vite doesn't bundle this
|
||||||
|
|||||||
Reference in New Issue
Block a user