Compare commits

...
3 Commits
4 changed files with 13 additions and 27 deletions

No files matched your search

+6 -6
View File
@@ -1,13 +1,13 @@
var db = db.getSiblingDB('omdb');
var db = db.getSiblingDB('om');
// Delete all collections + all records
db.messages.deleteMany({});
db.tags.deleteMany({});
db.users.deleteMany({});
db.sessions.deleteMany({});
//db.messages.deleteMany({});
//db.tags.deleteMany({});
//db.users.deleteMany({});
//db.sessions.deleteMany({});
// Insert data in collections
load('mong_msg.js');
//load('mong_msg.js');
load('mong_tag.js');
load('mong_usr.js');
+2 -2
View File
@@ -1,8 +1,8 @@
db.users.insert([
// User: author, Pwd: author
{"_id":"author","name":"Author","type":"MA@EFI;","roles":'{"user":true,"author":true}',"hash":"sha256","salt":"SIzKNsNKsCRVr8a9U90q6A==","pwd":"HZly68TSAKHioz6Kz0QCbXVTHpT6hMmabUbFYVlCMeE=","abos":["nulla","tempor","veniam","ipsum"],"bookmarks":[],},
{"_id":"author","name":"Author","type":"PF@EFI;","roles":'{"user":true,"author":true}',"hash":"sha256","salt":"SIzKNsNKsCRVr8a9U90q6A==","pwd":"HZly68TSAKHioz6Kz0QCbXVTHpT6hMmabUbFYVlCMeE=","abos":[],"bookmarks":[],},
// User: admin, Pwd: SwenMho
{"_id":"admin","name":"Test Admin","type":"MA@AMP;","roles":'{"user":true,"author":true,"admin":true}',"hash":"sha256","salt":"z3PNXGmQaWvaT7m2ZlT+0w==","pwd":"nfUfNv032J745xj3Hzya3Mkk43Dz/H0BmNTZhtx8UM0=","abos":["veniam","ipsum"],"bookmarks":[],},
// {"_id":"admin","name":"Test Admin","type":"MA@AMP;","roles":'{"user":true,"author":true,"admin":true}',"hash":"sha256","salt":"z3PNXGmQaWvaT7m2ZlT+0w==","pwd":"nfUfNv032J745xj3Hzya3Mkk43Dz/H0BmNTZhtx8UM0=","abos":["veniam","ipsum"],"bookmarks":[],},
])
//var c = require('./server/crypto.js'),
+5 -5
View File
@@ -60,10 +60,10 @@ app.use(session({
secure: true, // true for https only (since our app works only with https)
},
name: 'om.sid',
store: new MongoStore({
mongooseConnection: mong.connection,
ttl: 30 * 24 * 3600,
}), // mongoose + connect-mongo
// store: new MongoStore({
// mongooseConnection: mong.connection,
// ttl: 30 * 24 * 3600,
// }), // mongoose + connect-mongo
//store: new MemoryStore ({checkPeriod: 24*3600*1000}), // memorystore
}));
@@ -112,7 +112,7 @@ app.use('/api', api_routes);
app.use(express.static(__dirname + '/public'));
// Other stuff is NOT authorized unless logged in
app.use (authorize.genCheckAuthorized ('user'));
//app.use (authorize.genCheckAuthorized ('user'));
// No error so far? Then it's a 404!
app.use(function (req, res, next) {
-14
View File
@@ -386,18 +386,4 @@ const dbs = {
models: model,
};
/*
app.get ("/api/msg/search/:phrase", function (req, res) {
Message.find ({$text: {$search: req.params.phrase}) .then (function (err, results){
if (err) {
console.log (err);
res .status(404) .json (err);
} else {
console.log(JSON.stringify(results));
res.json(results);
}
});
});
*/
module.exports = dbs;