mirror of https://github.com/calzoneman/sync.git
Do a bit of intermediate database work
This commit is contained in:
parent
b889f7b4c8
commit
cfd1b0618d
371
lib/database.js
371
lib/database.js
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,12 @@
|
|||
//var db = require("../database");
|
||||
var $util = require("../utilities");
|
||||
var bcrypt = require("bcrypt");
|
||||
var db = require("../database");
|
||||
|
||||
var registrationLock = {};
|
||||
var blackHole = function () { };
|
||||
|
||||
module.exports = function (db) {
|
||||
return {
|
||||
module.exports = {
|
||||
/**
|
||||
* Initialize the accounts table
|
||||
*/
|
||||
|
@ -494,5 +494,4 @@ module.exports = function (db) {
|
|||
|
||||
callback(new Error("recoverPassword is not implemented"), null);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
|
@ -67,13 +67,26 @@ var Server = function (cfg) {
|
|||
|
||||
// database init ------------------------------------------------------
|
||||
var Database = require("./database");
|
||||
self.db = new Database(self.cfg);
|
||||
self.db = Database;
|
||||
self.db.init(self.cfg);
|
||||
|
||||
// webserver init -----------------------------------------------------
|
||||
self.httplog = new Logger.Logger(path.join(__dirname,
|
||||
"../httpaccess.log"));
|
||||
self.express = express();
|
||||
require("./web/webserver").init(self.express);
|
||||
self.express.get("/old/:channel(*)", function (req, res, next) {
|
||||
var c = req.params.channel;
|
||||
if (!$util.isValidChannelName(c)) {
|
||||
res.redirect("/" + c);
|
||||
return;
|
||||
}
|
||||
|
||||
self.logHTTP(req);
|
||||
res.sendfile("channel.html", {
|
||||
root: path.join(__dirname, "../www")
|
||||
});
|
||||
});
|
||||
/*
|
||||
self.express.use(express.urlencoded());
|
||||
self.express.use(express.json());
|
||||
|
|
|
@ -478,7 +478,7 @@ $(window).resize(function() {
|
|||
/* load channel */
|
||||
|
||||
var loc = document.location+"";
|
||||
var m = loc.match(/\/r\/([a-zA-Z0-9-_]+)$/);
|
||||
var m = loc.match(/\/old\/([a-zA-Z0-9-_]+)$/);
|
||||
if(m) {
|
||||
CHANNEL.name = m[1];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue