about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAlan Pearce2024-04-01 20:11:44 +0200
committerAlan Pearce2024-04-01 20:11:44 +0200
commit53d704777f8899b8750b083cef47b8fdf5830373 (patch)
treeab3f2cfced000d0459121184c154c235ae57c7db /src
parent734fbe8444db4454953663dd263a5778f8742eeb (diff)
downloadwebsite-53d704777f8899b8750b083cef47b8fdf5830373.tar.lz
website-53d704777f8899b8750b083cef47b8fdf5830373.tar.zst
website-53d704777f8899b8750b083cef47b8fdf5830373.zip
Use import.meta instead of Bun to get envvars
Diffstat (limited to 'src')
-rw-r--r--src/app.ts8
-rw-r--r--src/index.ts2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/app.ts b/src/app.ts
index cdabb3a..0f8f08d 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -8,15 +8,17 @@ import log from "loglevel";
 
 import config from "./config";
 
-log.setLevel((Bun.env.LOG_LEVEL || "info") as log.LogLevelDesc);
+log.setLevel((import.meta.env.LOG_LEVEL || "info") as log.LogLevelDesc);
 
 Sentry.init({
-  release: `homestead@${Bun.env.FLY_MACHINE_VERSION}`,
+  release: `homestead@${import.meta.env.FLY_MACHINE_VERSION}`,
   tracesSampleRate: 1.0,
 });
 
 const expectedHostURL = new URL(
-  Bun.env.NODE_ENV === "production" ? config.base_url : "http://localhost:3000",
+  import.meta.env.NODE_ENV === "production"
+    ? config.base_url
+    : "http://localhost:3000",
 );
 const defaultHeaders = {
   ...config.extra.headers,
diff --git a/src/index.ts b/src/index.ts
index 9e806ba..c12d153 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -2,7 +2,7 @@ import log from "loglevel";
 
 import { server, metricsServer } from "./app";
 
-log.setLevel((Bun.env.LOG_LEVEL || "info") as log.LogLevelDesc);
+log.setLevel((import.meta.env.LOG_LEVEL || "info") as log.LogLevelDesc);
 
 const metricsServed = Bun.serve(metricsServer);
 console.info(`Metrics server started on port ${metricsServed.port}`);