diff --git a/src/app.js b/src/app.js index 4f9e4aa..3c1344d 100644 --- a/src/app.js +++ b/src/app.js @@ -6,6 +6,7 @@ import mongoose from "mongoose"; import flash from "connect-flash"; import session from "express-session"; import MongoStore from "connect-mongo"; +import debugLib from "debug"; import passportConfig from "./libs/passport"; @@ -29,11 +30,13 @@ import importMeRouterApiV1 from "./routes/api/v1/me"; import importContactRouterApiV1 from "./routes/api/v1/contact"; passportConfig(passport); +const debug = debugLib("musictopus:errors"); mongoose.set("strictQuery", false); mongoose .connect(mongoDbUri, { useNewUrlParser: true, useUnifiedTopology: true }) - .catch(() => { + .catch((err) => { + debug(`Mongo error:`, err); process.exit(); });