first commit
This commit is contained in:
16
backend/src/config/env.ts
Normal file
16
backend/src/config/env.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
export const config = {
|
||||
port: parseInt(process.env.PORT || "4000", 10),
|
||||
mongoUri: process.env.MONGO_URI || "mongodb://mongo:27017/wisecoltci",
|
||||
adminUsername: process.env.ADMIN_USERNAME || "admin",
|
||||
adminPassword: process.env.ADMIN_PASSWORD || "password",
|
||||
jwtSecret: process.env.JWT_SECRET || "changeme",
|
||||
clientOrigin: process.env.CLIENT_ORIGIN || "http://localhost:5173"
|
||||
};
|
||||
|
||||
if (!config.jwtSecret) {
|
||||
throw new Error("JWT_SECRET is required");
|
||||
}
|
||||
Reference in New Issue
Block a user