summaryrefslogtreecommitdiff
path: root/backend/node/src/app.js
Side-by-side diff
Diffstat (limited to 'backend/node/src/app.js') (more/less context) (show whitespace changes)
-rw-r--r--backend/node/src/app.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/backend/node/src/app.js b/backend/node/src/app.js
index d4d60c2..61c2c72 100644
--- a/backend/node/src/app.js
+++ b/backend/node/src/app.js
@@ -17,6 +17,16 @@ var EXPRESS = require('express');
var HTTP = require('http');
var PATH = require('path');
+
+var CLIPPERZ = require('./clipperz');
+var CONF = require('./conf');
+var clipperz = CLIPPERZ({
+ psql: CONF.psql||'postgresql:///clipperz',
+ logger: LOGGER,
+ dump_template: PATH.join(__dirname,'htdocs/beta/index.html')
+});
+
+
var app = EXPRESS();
app.set('port', process.env.PORT || 3000);
@@ -24,7 +34,7 @@ app.use(EXPRESS.logger('dev'));
app.use(EXPRESS.urlencoded());
app.use(EXPRESS.methodOverride());
app.use(EXPRESS.cookieParser('your secret here'));
-app.use(EXPRESS.session());
+app.use(EXPRESS.session({secret:'99 little bugs in the code', key:'sid', store: clipperz.session_store() }));
app.use(app.router);
app.use(EXPRESS.static(PATH.join(__dirname, 'htdocs/')));
if ('development' == app.get('env')) {
@@ -32,14 +42,6 @@ if ('development' == app.get('env')) {
}
-var CLIPPERZ = require('./clipperz');
-var CONF = require('./conf');
-var clipperz = CLIPPERZ({
- psql: CONF.psql||'postgresql:///clipperz',
- logger: LOGGER,
- dump_template: PATH.join(__dirname,'htdocs/beta/index.html')
-});
-
app.post('/json',clipperz.json);
app.get('/beta/dump',clipperz.dump);