Update express dependency

This commit is contained in:
calzoneman 2014-08-19 00:07:24 -05:00
parent c2ba55ac0f
commit 5f7adc98ba
2 changed files with 17 additions and 14 deletions

View File

@ -9,6 +9,8 @@ var $util = require("../utilities");
var Logger = require("../logger"); var Logger = require("../logger");
var Config = require("../config"); var Config = require("../config");
var db = require("../database"); var db = require("../database");
var bodyParser = require("body-parser");
var cookieParser = require("cookie-parser");
var httplog = new Logger.Logger(path.join(__dirname, "..", "..", "http.log")); var httplog = new Logger.Logger(path.join(__dirname, "..", "..", "http.log"));
@ -257,13 +259,13 @@ function static(dir) {
return; return;
} }
res.sendfile(req.path.replace(/^\//, ""), { res.sendFile(req.path.replace(/^\//, ""), {
maxAge: Config.get("http.cache-ttl") * 1000, maxAge: Config.get("http.cache-ttl") * 1000,
root: dir root: dir
}, function (err) { }, function (err) {
logRequest(req); logRequest(req);
if (err) { if (err) {
res.send(err.status); res.status(err.status).end();
} }
}); });
} catch (e) { } catch (e) {
@ -278,9 +280,8 @@ module.exports = {
* Initializes webserver callbacks * Initializes webserver callbacks
*/ */
init: function (app) { init: function (app) {
app.use(express.json()); app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.urlencoded()); app.use(cookieParser());
app.use(express.cookieParser());
if (Config.get("http.minify")) { if (Config.get("http.minify")) {
var cache = path.join(__dirname, "..", "..", "www", "cache") var cache = path.join(__dirname, "..", "..", "www", "cache")

View File

@ -7,17 +7,19 @@
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },
"dependencies": { "dependencies": {
"express": "~3.4.8",
"bcrypt": "~0.7.7", "bcrypt": "~0.7.7",
"mysql": "~2.0.1", "body-parser": "^1.6.5",
"jade": "~1.1.5",
"socket.io": "~0.9.16",
"nodemailer": "~0.6.0",
"cookie": "~0.1.0", "cookie": "~0.1.0",
"yamljs": "~0.1.4", "cookie-parser": "^1.3.2",
"express-minify": "0.0.7", "express": "^4.8.5",
"q": "^1.0.0", "express-minify": "0.0.11",
"jade": "~1.1.5",
"json-typecheck": "^0.1.0", "json-typecheck": "^0.1.0",
"oauth": "^0.9.11" "mysql": "~2.0.1",
"nodemailer": "~0.6.0",
"oauth": "^0.9.11",
"q": "^1.0.0",
"socket.io": "~0.9.16",
"yamljs": "~0.1.4"
} }
} }