Skip to content

Commit 0489179

Browse files
committed
chore: refactor dotenv configuration
- Removed dotenv configuration from src/app.ts to streamline the app initialization. - Moved dotenv configuration to a dedicated src/utils/envConfig.ts file for better organization and maintainability. - This change enhances code clarity by separating environment variable management from the main application logic.
1 parent 8f5f6b8 commit 0489179

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/app.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import express from "express";
2-
import dotenv from "dotenv";
32
import cors from "cors";
43
import requestLogger from "./middlewares/requestLogger";
54
import errorRoutes from "./routes/errorRoutes";
65
import integrationRoutes from "./routes/integrations";
76
import tickRoute from "./routes/tick";
8-
dotenv.config();
97

108
const app = express();
119
app.use(express.json());

src/utils/envConfig.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import { config } from "dotenv";
2+
3+
config();
4+
15
export const ENV_CONFIG = {
26
PORT: process.env.PORT || 4000,
37
SERVER_URL: process.env.SERVER_URL || "http://localhost:4000",

0 commit comments

Comments
 (0)