summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--backend/node/src/app.js7
-rw-r--r--backend/node/src/clipperz.js6
2 files changed, 10 insertions, 3 deletions
diff --git a/backend/node/src/app.js b/backend/node/src/app.js
index bbc62f8..09dcfac 100644
--- a/backend/node/src/app.js
+++ b/backend/node/src/app.js
@@ -36,8 +36,9 @@ app.use(require('cookie-parser')('your secret here'));
36app.use(require('express-session')({secret:'99 little bugs in the code', key:'sid', store: clipperz.session_store(), resave: false, saveUninitialized: false })); 36app.use(require('express-session')({secret:'99 little bugs in the code', key:'sid', store: clipperz.session_store(), resave: false, saveUninitialized: false }));
37 37
38app.post('/json',clipperz.json); 38/* Like this: */
39app.get('/dump',clipperz.dump); 39app.use(clipperz.router);
40/* Or this: */
41app.use('/clz/',clipperz.router);
40 42
41app.use(EXPRESS.static(PATH.join(__dirname, 'htdocs/')));
42if ('development' == app.get('env')) { 43if ('development' == app.get('env')) {
43 app.use(require('express-error-with-sources')()); 44 app.use(require('express-error-with-sources')());
diff --git a/backend/node/src/clipperz.js b/backend/node/src/clipperz.js
index 842de31..2a3df73 100644
--- a/backend/node/src/clipperz.js
+++ b/backend/node/src/clipperz.js
@@ -3,4 +3,6 @@ var CRYPTO = require('crypto');
3var BIGNUM = require('bignum'); 3var BIGNUM = require('bignum');
4var ASYNC = require('async'); 4var ASYNC = require('async');
5var EXPRESS = require('express');
6var PATH = require('path');
5 7
6var express_store = require('express-session').Store; 8var express_store = require('express-session').Store;
@@ -580,4 +582,8 @@ var CLIPPERZ = module.exports = function(CONFIG) {
580 rv.__defineGetter__('session_store',function(){ return function(o) { return new (clipperz_store(PG))(o) } }); 582 rv.__defineGetter__('session_store',function(){ return function(o) { return new (clipperz_store(PG))(o) } });
581 583
584 (rv.router = require('express').Router())
585 .post('/json',rv.json).get('/dump',rv.dump)
586 .use(EXPRESS.static(PATH.join(__dirname,'htdocs/')));
587
582 return rv; 588 return rv;
583 589