Skip to content

Commit 91ab014

Browse files
committed
api: Load envvars before they are used by the DB clients
1 parent 35f1eec commit 91ab014

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/api/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
import dotenv from "dotenv";
2+
3+
dotenv.config({
4+
path: "./.env",
5+
});
6+
17
import { SocketIoInstrumentation } from "@opentelemetry/instrumentation-socket.io";
28
import * as Sentry from "@sentry/node";
3-
import dotenv from "dotenv";
9+
10+
411
import type { Socket } from "socket.io";
512
import type { NamespaceProxyTarget } from "socket-call-server";
613

@@ -45,10 +52,6 @@ export type UserServices<OptionalUser = false> = NamespaceProxyTarget<
4552
return int ?? this.toString();
4653
};
4754

48-
dotenv.config({
49-
path: "./.env",
50-
});
51-
5255
// Validate required environment variables
5356
const requiredEnvVars = [
5457
'DATABASE_URL_DM',

0 commit comments

Comments
 (0)