|
|
@@ -7,22 +7,10 @@ const config = require('../config/config.json');
|
|
|
// const Role = require('../lib/role');
|
|
|
//const db = config.url;
|
|
|
|
|
|
-<<<<<<< HEAD
|
|
|
-var db = 'mongodb://database_preprod:27017/mean-fatboar-db';
|
|
|
-=======
|
|
|
-<<<<<<< HEAD
|
|
|
-var db = 'mongodb://mongodb-preprod.foodgame.fr:27017/mean-fatboar-db?w=majority&readPreference=primary&retryWrites=true&directConnection=true&ssl=false';
|
|
|
-//var mongoURI = 'mongodb://localhost:27017/my-db';
|
|
|
-//mongoose.set('useCreateIndex', true)
|
|
|
-mongoose.connect(db, {//useNewUrlParser: true,
|
|
|
- useUnifiedTopology: true, })
|
|
|
-=======
|
|
|
-//var db = 'mongodb://database_preprod:27017/mean-fatboar-db';
|
|
|
->>>>>>> dev
|
|
|
+var db = 'mongodb://database_prod:27017/mean-fatboar-db';
|
|
|
//var mongoURI = 'mongodb://localhost:27017/my-db';
|
|
|
//mongoose.set('useCreateIndex', true)
|
|
|
mongoose.connect(db, {useNewUrlParser: true, useUnifiedTopology: true })
|
|
|
->>>>>>> test
|
|
|
.then(() => {
|
|
|
console.log("Successfully connected to the database.");
|
|
|
}).catch(err => {
|
|
|
@@ -57,21 +45,21 @@ module.exports = mongoose.connection;
|
|
|
// });
|
|
|
// resto.save();
|
|
|
|
|
|
-const salt = bcrypt.genSaltSync(12);
|
|
|
- password = bcrypt.hashSync('Pass@123', 12);
|
|
|
- console.log('fgfg', password);
|
|
|
-let date = new Date(1997, 1 , 12 , 20, 40);
|
|
|
+// const salt = bcrypt.genSaltSync(12);
|
|
|
+// password = bcrypt.hashSync('Pass@123', 12);
|
|
|
+// console.log('fgfg', password);
|
|
|
+// let date = new Date(1997, 1 , 12 , 20, 40);
|
|
|
|
|
|
- const user = new User({
|
|
|
- firstname: " adrien",
|
|
|
- lastname: "xxxxxxx",
|
|
|
- email: "adrien@hotmail.fr",
|
|
|
- role: 'admin',
|
|
|
- birthday: date,
|
|
|
- phonenumber: '0680705876',
|
|
|
- isActive: true,
|
|
|
- password: password
|
|
|
- });
|
|
|
+// const user = new User({
|
|
|
+// firstname: " adrien",
|
|
|
+// lastname: "xxxxxxx",
|
|
|
+// email: "adrien@hotmail.fr",
|
|
|
+// role: 'admin',
|
|
|
+// birthday: date,
|
|
|
+// phonenumber: '0680705876',
|
|
|
+// isActive: true,
|
|
|
+// password: password
|
|
|
+// });
|
|
|
|
|
|
|
|
|
- user.save();
|
|
|
+// user.save();
|