author | Michael Krelin <hacker@klever.net> | 2014-06-29 19:56:24 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2014-06-29 20:48:06 (UTC) |
commit | a90f522c1e06149420a14100f34b252d7b1119c4 (patch) (unidiff) | |
tree | abf7c66495d5634d1f509f60d36703416cdb15b3 /backend | |
parent | d07d0f16c064ddf2f51fb506ea77000d2eebce71 (diff) | |
download | clipperz-a90f522c1e06149420a14100f34b252d7b1119c4.zip clipperz-a90f522c1e06149420a14100f34b252d7b1119c4.tar.gz clipperz-a90f522c1e06149420a14100f34b252d7b1119c4.tar.bz2 |
update node modules and adjust for the newer express
-rw-r--r-- | backend/node/src/app.js | 18 | ||||
-rw-r--r-- | backend/node/src/clipperz.js | 2 | ||||
-rw-r--r-- | backend/node/src/package.json | 15 |
3 files changed, 20 insertions, 15 deletions
diff --git a/backend/node/src/app.js b/backend/node/src/app.js index 61c2c72..ca05e6f 100644 --- a/backend/node/src/app.js +++ b/backend/node/src/app.js | |||
@@ -30,20 +30,20 @@ var clipperz = CLIPPERZ({ | |||
30 | var app = EXPRESS(); | 30 | var app = EXPRESS(); |
31 | 31 | ||
32 | app.set('port', process.env.PORT || 3000); | 32 | app.set('port', process.env.PORT || 3000); |
33 | app.use(EXPRESS.logger('dev')); | 33 | app.use(require('morgan')('dev')); |
34 | app.use(EXPRESS.urlencoded()); | 34 | app.use(require('body-parser').urlencoded({extended:true})); |
35 | app.use(EXPRESS.methodOverride()); | 35 | app.use(require('cookie-parser')('your secret here')); |
36 | app.use(EXPRESS.cookieParser('your secret here')); | 36 | app.use(require('express-session')({secret:'99 little bugs in the code', key:'sid', store: clipperz.session_store(), resave: false, saveUninitialized: false })); |
37 | app.use(EXPRESS.session({secret:'99 little bugs in the code', key:'sid', store: clipperz.session_store() })); | 37 | |
38 | app.use(app.router); | 38 | app.post('/json',clipperz.json); |
39 | app.get('/beta/dump',clipperz.dump); | ||
40 | |||
39 | app.use(EXPRESS.static(PATH.join(__dirname, 'htdocs/'))); | 41 | app.use(EXPRESS.static(PATH.join(__dirname, 'htdocs/'))); |
40 | if ('development' == app.get('env')) { | 42 | if ('development' == app.get('env')) { |
41 | app.use(EXPRESS.errorHandler()); | 43 | app.use(require('express-error-with-sources')()); |
42 | } | 44 | } |
43 | 45 | ||
44 | 46 | ||
45 | app.post('/json',clipperz.json); | ||
46 | app.get('/beta/dump',clipperz.dump); | ||
47 | 47 | ||
48 | 48 | ||
49 | HTTP.createServer(app).listen(app.get('port'), function(){ | 49 | HTTP.createServer(app).listen(app.get('port'), function(){ |
diff --git a/backend/node/src/clipperz.js b/backend/node/src/clipperz.js index 04b054a..c51b0bc 100644 --- a/backend/node/src/clipperz.js +++ b/backend/node/src/clipperz.js | |||
@@ -3,7 +3,7 @@ var CRYPTO = require('crypto'); | |||
3 | var BIGNUM = require('bignum'); | 3 | var BIGNUM = require('bignum'); |
4 | var ASYNC = require('async'); | 4 | var ASYNC = require('async'); |
5 | 5 | ||
6 | var express_store = require('express').session.Store; | 6 | var express_store = require('express-session').Store; |
7 | 7 | ||
8 | function clipperz_hash(v) { | 8 | function clipperz_hash(v) { |
9 | return CRYPTO.createHash('sha256').update( | 9 | return CRYPTO.createHash('sha256').update( |
diff --git a/backend/node/src/package.json b/backend/node/src/package.json index 825f756..98755bd 100644 --- a/backend/node/src/package.json +++ b/backend/node/src/package.json | |||
@@ -6,10 +6,15 @@ | |||
6 | "start": "node app 2>&1 | ./node_modules/.bin/bunyan" | 6 | "start": "node app 2>&1 | ./node_modules/.bin/bunyan" |
7 | }, | 7 | }, |
8 | "dependencies": { | 8 | "dependencies": { |
9 | "express": "3.4.4", | 9 | "async": "^0.9.0", |
10 | "async": "~0.2.9", | 10 | "bignum": "^0.8.0", |
11 | "bignum": "~0.6.2", | 11 | "body-parser": "^1.4.3", |
12 | "pg": "~2.8.3", | 12 | "bunyan": "^0.23.1", |
13 | "bunyan": "~0.22.0" | 13 | "cookie-parser": "^1.3.2", |
14 | "express": "^4.4.5", | ||
15 | "express-error-with-sources": "^1.3.1", | ||
16 | "express-session": "^1.6.1", | ||
17 | "morgan": "^1.1.1", | ||
18 | "pg": "^3.3.0" | ||
14 | } | 19 | } |
15 | } | 20 | } |