Skip to content

Commit

Permalink
mongo auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon1320 committed Sep 10, 2018
1 parent 9626a4e commit 270b2ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
const mongoose = require("mongoose");

const Logger = require("./logger");
const config = require("../config.json");

const genLogger = new Logger();

mongoose.connect("mongodb://localhost/rawrxd");
mongoose.connect(`mongodb://${config.mongo_user === null && config.mongo_pass === null ? "" : `${config.mongo_user}:${config.mongo_pass}@`}localhost/rawrxd`);
mongoose.Promise = global.Promise;

const db = mongoose.connection;
Expand Down

0 comments on commit 270b2ec

Please sign in to comment.