Compare commits
3
Commits
master
...
84e73466e1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84e73466e1 | ||
|
|
31ba4a0b8b | ||
|
|
dda5e89990 |
No files matched your search
@@ -1,13 +1,13 @@
|
|||||||
var db = db.getSiblingDB('omdb');
|
var db = db.getSiblingDB('om');
|
||||||
|
|
||||||
// Delete all collections + all records
|
// Delete all collections + all records
|
||||||
db.messages.deleteMany({});
|
//db.messages.deleteMany({});
|
||||||
db.tags.deleteMany({});
|
//db.tags.deleteMany({});
|
||||||
db.users.deleteMany({});
|
//db.users.deleteMany({});
|
||||||
db.sessions.deleteMany({});
|
//db.sessions.deleteMany({});
|
||||||
|
|
||||||
// Insert data in collections
|
// Insert data in collections
|
||||||
load('mong_msg.js');
|
//load('mong_msg.js');
|
||||||
load('mong_tag.js');
|
load('mong_tag.js');
|
||||||
load('mong_usr.js');
|
load('mong_usr.js');
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
db.users.insert([
|
db.users.insert([
|
||||||
// User: author, Pwd: author
|
// 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
|
// 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'),
|
//var c = require('./server/crypto.js'),
|
||||||
|
|||||||
@@ -60,10 +60,10 @@ app.use(session({
|
|||||||
secure: true, // true for https only (since our app works only with https)
|
secure: true, // true for https only (since our app works only with https)
|
||||||
},
|
},
|
||||||
name: 'om.sid',
|
name: 'om.sid',
|
||||||
store: new MongoStore({
|
// store: new MongoStore({
|
||||||
mongooseConnection: mong.connection,
|
// mongooseConnection: mong.connection,
|
||||||
ttl: 30 * 24 * 3600,
|
// ttl: 30 * 24 * 3600,
|
||||||
}), // mongoose + connect-mongo
|
// }), // mongoose + connect-mongo
|
||||||
//store: new MemoryStore ({checkPeriod: 24*3600*1000}), // memorystore
|
//store: new MemoryStore ({checkPeriod: 24*3600*1000}), // memorystore
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ app.use('/api', api_routes);
|
|||||||
app.use(express.static(__dirname + '/public'));
|
app.use(express.static(__dirname + '/public'));
|
||||||
|
|
||||||
// Other stuff is NOT authorized unless logged in
|
// 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!
|
// No error so far? Then it's a 404!
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
|
|||||||
@@ -386,18 +386,4 @@ const dbs = {
|
|||||||
models: model,
|
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;
|
module.exports = dbs;
|
||||||
Reference in new issue
Block a user