chore: fix production build

This commit is contained in:
Tom Moor
2025-01-30 21:38:04 -05:00
parent 28aebc9fbf
commit aa879d8fab

View File

@ -9,9 +9,11 @@ import { viteStaticCopy } from "vite-plugin-static-copy";
import environment from "./server/utils/environment";
let httpsConfig: CommonServerOptions["https"] | undefined;
const host = new URL(environment.URL!).hostname;
let host: string | undefined;
if (environment.NODE_ENV === "development") {
host = host = new URL(environment.URL!).hostname;
try {
httpsConfig = {
key: fs.readFileSync("./server/config/certs/private.key"),
@ -32,7 +34,7 @@ export default () =>
port: 3001,
host: true,
https: httpsConfig,
allowedHosts: [host],
allowedHosts: host ? [host] : undefined,
cors: true,
fs:
environment.NODE_ENV === "development"