Skip to content

Commit

Permalink
refactor: ♻️ use dotenv for reading env variable in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
pshaddel committed Apr 28, 2024
1 parent 391f53b commit 6d79ddd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import helmet from "helmet";
import { config } from "../config";
import { userRouter } from "./user/user.route";
import "@total-typescript/ts-reset";
import dotenv from "dotenv";

dotenv.config({ path: "../.env" });

const app = express();

Expand All @@ -28,7 +31,7 @@ app.use(userRouter);

app.use((_, res) => {
res.status(404).send("Not found");
})
});

if (!config.isTestEnvironment) {
app.listen(config.port);
Expand Down

0 comments on commit 6d79ddd

Please sign in to comment.