-rw-r--r-- | backend/node/properties/node.properties.json | 4 | ||||
-rw-r--r-- | backend/node/src/app.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/backend/node/properties/node.properties.json b/backend/node/properties/node.properties.json index 6bb8860..e6f9e7e 100644 --- a/backend/node/properties/node.properties.json +++ b/backend/node/properties/node.properties.json | |||
@@ -1,5 +1,5 @@ | |||
1 | { | 1 | { |
2 | "request.path": "/json", | 2 | "request.path": "../json", |
3 | "dump.path": "../dump", | 3 | "dump.path": "/../dump", |
4 | "should.pay.toll": "false" | 4 | "should.pay.toll": "false" |
5 | } | 5 | } |
diff --git a/backend/node/src/app.js b/backend/node/src/app.js index ca05e6f..bbc62f8 100644 --- a/backend/node/src/app.js +++ b/backend/node/src/app.js | |||
@@ -1,51 +1,51 @@ | |||
1 | var BUNYAN = require('bunyan'); | 1 | var BUNYAN = require('bunyan'); |
2 | var LOGGER = BUNYAN.createLogger({ | 2 | var LOGGER = BUNYAN.createLogger({ |
3 | name: 'clipperz', | 3 | name: 'clipperz', |
4 | streams: [ | 4 | streams: [ |
5 | { name: "console", stream:process.stderr,level:'trace'} | 5 | { name: "console", stream:process.stderr,level:'trace'} |
6 | ], | 6 | ], |
7 | serializers: { | 7 | serializers: { |
8 | req: BUNYAN.stdSerializers.req, | 8 | req: BUNYAN.stdSerializers.req, |
9 | res: BUNYAN.stdSerializers.res, | 9 | res: BUNYAN.stdSerializers.res, |
10 | err: BUNYAN.stdSerializers.err | 10 | err: BUNYAN.stdSerializers.err |
11 | }, | 11 | }, |
12 | src: true | 12 | src: true |
13 | }); | 13 | }); |
14 | 14 | ||
15 | 15 | ||
16 | var EXPRESS = require('express'); | 16 | var EXPRESS = require('express'); |
17 | var HTTP = require('http'); | 17 | var HTTP = require('http'); |
18 | var PATH = require('path'); | 18 | var PATH = require('path'); |
19 | 19 | ||
20 | 20 | ||
21 | var CLIPPERZ = require('./clipperz'); | 21 | var CLIPPERZ = require('./clipperz'); |
22 | var CONF = require('./conf'); | 22 | var CONF = require('./conf'); |
23 | var clipperz = CLIPPERZ({ | 23 | var clipperz = CLIPPERZ({ |
24 | psql: CONF.psql||'postgresql:///clipperz', | 24 | psql: CONF.psql||'postgresql:///clipperz', |
25 | logger: LOGGER, | 25 | logger: LOGGER, |
26 | dump_template: PATH.join(__dirname,'htdocs/beta/index.html') | 26 | dump_template: PATH.join(__dirname,'htdocs/beta/index.html') |
27 | }); | 27 | }); |
28 | 28 | ||
29 | 29 | ||
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(require('morgan')('dev')); | 33 | app.use(require('morgan')('dev')); |
34 | app.use(require('body-parser').urlencoded({extended:true})); | 34 | app.use(require('body-parser').urlencoded({extended:true})); |
35 | app.use(require('cookie-parser')('your secret here')); | 35 | app.use(require('cookie-parser')('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 })); | 36 | app.use(require('express-session')({secret:'99 little bugs in the code', key:'sid', store: clipperz.session_store(), resave: false, saveUninitialized: false })); |
37 | 37 | ||
38 | app.post('/json',clipperz.json); | 38 | app.post('/json',clipperz.json); |
39 | app.get('/beta/dump',clipperz.dump); | 39 | app.get('/dump',clipperz.dump); |
40 | 40 | ||
41 | app.use(EXPRESS.static(PATH.join(__dirname, 'htdocs/'))); | 41 | app.use(EXPRESS.static(PATH.join(__dirname, 'htdocs/'))); |
42 | if ('development' == app.get('env')) { | 42 | if ('development' == app.get('env')) { |
43 | app.use(require('express-error-with-sources')()); | 43 | app.use(require('express-error-with-sources')()); |
44 | } | 44 | } |
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
49 | HTTP.createServer(app).listen(app.get('port'), function(){ | 49 | HTTP.createServer(app).listen(app.get('port'), function(){ |
50 | LOGGER.info({port:app.get('port')},"Listener established"); | 50 | LOGGER.info({port:app.get('port')},"Listener established"); |
51 | }); | 51 | }); |