forked from dbroqua/MusicTopus
{DEBUG} For mongodb connection
This commit is contained in:
parent
478b54da53
commit
eef31967ba
1 changed files with 4 additions and 1 deletions
|
@ -6,6 +6,7 @@ import mongoose from "mongoose";
|
||||||
import flash from "connect-flash";
|
import flash from "connect-flash";
|
||||||
import session from "express-session";
|
import session from "express-session";
|
||||||
import MongoStore from "connect-mongo";
|
import MongoStore from "connect-mongo";
|
||||||
|
import debugLib from "debug";
|
||||||
|
|
||||||
import passportConfig from "./libs/passport";
|
import passportConfig from "./libs/passport";
|
||||||
|
|
||||||
|
@ -29,11 +30,13 @@ import importMeRouterApiV1 from "./routes/api/v1/me";
|
||||||
import importContactRouterApiV1 from "./routes/api/v1/contact";
|
import importContactRouterApiV1 from "./routes/api/v1/contact";
|
||||||
|
|
||||||
passportConfig(passport);
|
passportConfig(passport);
|
||||||
|
const debug = debugLib("musictopus:errors");
|
||||||
|
|
||||||
mongoose.set("strictQuery", false);
|
mongoose.set("strictQuery", false);
|
||||||
mongoose
|
mongoose
|
||||||
.connect(mongoDbUri, { useNewUrlParser: true, useUnifiedTopology: true })
|
.connect(mongoDbUri, { useNewUrlParser: true, useUnifiedTopology: true })
|
||||||
.catch(() => {
|
.catch((err) => {
|
||||||
|
debug(`Mongo error:`, err);
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue