返回提交历史
Modified
src/services/mongoService.ts
+3
-3
XFEstudio/SpaceNinjaServer
Better error message when .env file is missing (#9)
ec95bab5
代码差异
1 个文件
+3
-3
@@ -5,9 +5,9 @@ dotenv.config();
5
5
6
6
const url = process.env.MONGODB_URL;
7
7
8
if (!url) throw new Error("MONGODB_URL not found");
9
10
console.log("connecting to MongoDB URL:", url);
8
if (url === undefined) {
9
throw new Error("MONGODB_URL not found. Make sure you have a .env file in the root of the project!");
10
}
11
11
12
12
const connectDatabase = async () => {
13
13
try {