debugging

This commit is contained in:
Martin Donnelly 2016-02-12 13:24:01 +00:00
parent 9e83bbf956
commit 8429b0ac2f
3 changed files with 129 additions and 1731 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,15 @@
"rss-braider": "^1.0.0"
},
"dependencies": {
"express": "^4.13.4"
"express": "^4.13.4",
"body-parser": "^1.14.2",
"cookie-parser": "*",
"ejs": "*",
"errorhandler": "*",
"morgan": "*",
"express-session": "*",
"htmlparser": "^1.7.7",
"method-override": "*",
"request": "*"
}
}

View File

@ -1,31 +1,38 @@
var express = require('express'), path = require('path'), http = require('http') ;
var express = require('express'), path = require('path'), http = require('http'), ejs = require('ejs'), morgan = require('morgan'), cookieparser = require('cookie-parser'), session = require('express-session');
var methodoverride = require('method-override'), bodyparser = require('body-parser'), errorhandler = require('errorhandler');
var app = express();
var lastcheck = 0;
var btcCache = {}, fxCache = {};
app.configure(function () {
//app.configure(function () {
app.set('port', 9002);
app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(express.session({secret: '1234567890QWERTY'}));
/* 'default', 'short', 'tiny', 'dev' */
app.use(express.methodOverride());
app.use(morgan('combined'));
app.use(cookieparser('your secret here'));
app.use(session({
secret: '1234567890QWERTY', resave: false,
saveUninitialized: false
}));
/* 'default', 'short', 'tiny', 'dev' */
app.use(methodoverride());
app.use(express.bodyParser());
app.use(bodyparser.urlencoded({extended: false}));
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
app.use(app.router);
// parse application/json
app.use(bodyparser.json());
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
//app.use(app.router);
app.use(express.static(path.join(__dirname, 'html')));
app.use(express.errorHandler({dumpExceptions: true, showStack: true}));
app.use(errorhandler({dumpExceptions: true, showStack: true}));
});
//});
/**
* create the server