XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

Better error message when .env file is missing (#9)

ec95bab5
Ângelo Tadeucci <angelo_tadeucci@hotmail.com.br>
提交于

代码差异

1 个文件 +3 -3
Modified src/services/mongoService.ts +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 {