added birmingham international , fixed a stupid scotrail bug and added a catch all for unhandled exceptions on the server
This commit is contained in:
parent
e75520817b
commit
05b2f920a4
@ -20,7 +20,7 @@ gulp.task('bundleBackbone', function () {
|
||||
return b.bundle()
|
||||
.pipe(source('app.js'))
|
||||
.pipe(buffer())
|
||||
.pipe(stripDebug())
|
||||
// .pipe(stripDebug())
|
||||
.pipe(rename('bundle.js'))
|
||||
|
||||
.pipe(sourcemaps.init({ 'loadMaps': true }))
|
||||
|
49
package-lock.json
generated
49
package-lock.json
generated
@ -152,8 +152,7 @@
|
||||
"amdefine": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
|
||||
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
|
||||
"dev": true
|
||||
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU="
|
||||
},
|
||||
"ansi-cyan": {
|
||||
"version": "0.1.1",
|
||||
@ -2173,6 +2172,25 @@
|
||||
"integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=",
|
||||
"dev": true
|
||||
},
|
||||
"compressjs": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/compressjs/-/compressjs-1.0.3.tgz",
|
||||
"integrity": "sha1-ldt03VuQOM+AvKMhqw7eJxtJWbY=",
|
||||
"requires": {
|
||||
"amdefine": "1.0.1",
|
||||
"commander": "2.8.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz",
|
||||
"integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=",
|
||||
"requires": {
|
||||
"graceful-readlink": "1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
@ -5305,8 +5323,7 @@
|
||||
"graceful-readlink": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
|
||||
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
|
||||
"dev": true
|
||||
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU="
|
||||
},
|
||||
"group-array": {
|
||||
"version": "0.3.3",
|
||||
@ -7676,6 +7693,15 @@
|
||||
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
|
||||
"dev": true
|
||||
},
|
||||
"json-lzw": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/json-lzw/-/json-lzw-0.3.2.tgz",
|
||||
"integrity": "sha1-1z50iajT1xkIAes+ZQV8FrsdG6E=",
|
||||
"requires": {
|
||||
"jsonpack": "1.1.5",
|
||||
"node-lzw": "0.3.1"
|
||||
}
|
||||
},
|
||||
"json-schema": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
|
||||
@ -7731,6 +7757,11 @@
|
||||
"resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
|
||||
"integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM="
|
||||
},
|
||||
"jsonpack": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/jsonpack/-/jsonpack-1.1.5.tgz",
|
||||
"integrity": "sha1-1CsNz9kaxY7zEQ+W0sWZQEw9wnw="
|
||||
},
|
||||
"jsonparse": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
|
||||
@ -8484,6 +8515,11 @@
|
||||
"es5-ext": "0.10.37"
|
||||
}
|
||||
},
|
||||
"lz77": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/lz77/-/lz77-1.1.0.tgz",
|
||||
"integrity": "sha1-FvMwoUx99YktqCSAwLbP7LzKd+M="
|
||||
},
|
||||
"macaddress": {
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/macaddress/-/macaddress-0.2.8.tgz",
|
||||
@ -9252,6 +9288,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node-lzw": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/node-lzw/-/node-lzw-0.3.1.tgz",
|
||||
"integrity": "sha1-9Q43lol2rKgzIAKLkfEB30pDay0="
|
||||
},
|
||||
"node-sass": {
|
||||
"version": "4.7.2",
|
||||
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.7.2.tgz",
|
||||
|
@ -14,11 +14,14 @@
|
||||
"babelify": "^8.0.0",
|
||||
"backbone": "^1.3.3",
|
||||
"browserify": "^14.5.0",
|
||||
"compressjs": "^1.0.3",
|
||||
"cors": "^2.8.4",
|
||||
"es6-promise": "^4.1.1",
|
||||
"express": "^4.16.2",
|
||||
"jquery": "^3.2.1",
|
||||
"json-lzw": "^0.3.2",
|
||||
"log4js": "^2.4.1",
|
||||
"lz77": "^1.1.0",
|
||||
"minibus": "^3.1.0",
|
||||
"muicss": "^0.9.33",
|
||||
"underscore": "^1.8.3"
|
||||
|
@ -1,5 +1,5 @@
|
||||
const express = require('express');
|
||||
const cors = require('cors')
|
||||
const cors = require('cors');
|
||||
|
||||
const path = require('path');
|
||||
const apicache = require('apicache');
|
||||
@ -25,6 +25,10 @@ app.use('/getnexttraintimes', cors(), cache('60 seconds'), train.getNextTrainTim
|
||||
app.use('/getroute', cors(), cache('60 seconds'), train.getRoute);
|
||||
app.use('/getnews', cors(), cache('30 minutes'), train.getNews);
|
||||
|
||||
process.on('uncaughtException', err => {
|
||||
logger.error(err);
|
||||
});
|
||||
|
||||
app.listen(port, (err) => {
|
||||
if (err)
|
||||
return logger.error('Server error:', err);
|
||||
|
@ -101,13 +101,19 @@ li {
|
||||
font-size:125%;
|
||||
}
|
||||
|
||||
#trains {
|
||||
#trains, #trainResults {
|
||||
overflow-y: auto;
|
||||
transition: all 0.5s;
|
||||
-webkit-transition: all 0.5s;
|
||||
|
||||
}
|
||||
|
||||
.tableBody {
|
||||
transition: all 0.5s;
|
||||
-webkit-transition: all 0.5s;
|
||||
|
||||
}
|
||||
|
||||
.unsliced {
|
||||
height:455px;
|
||||
}
|
||||
|
@ -20,7 +20,9 @@ const { RouteModel, RouteView } = require('./route');
|
||||
{ 'from': 'ptk', 'to': 'dbe' },
|
||||
{ 'from': 'glc', 'to': 'eus' },
|
||||
{ 'from': 'eus', 'to': 'glc' },
|
||||
{ 'from': 'pad', 'to': 'hxx' }
|
||||
{ 'from': 'pad', 'to': 'hxx' },
|
||||
{ 'from': 'glc', 'to': 'bhi' },
|
||||
{ 'from': 'bhi', 'to': 'glc' },
|
||||
],
|
||||
'views':{}
|
||||
|
||||
|
@ -220,7 +220,7 @@ const RouteView = Backbone.View.extend({
|
||||
// we have national rail messages so put a box at the top
|
||||
// <div class="mui--bg-danger .mui--text-white" style="height:10px;"></div>
|
||||
for (const item of route.nrccMessages) {
|
||||
const msg = item.value.replace('href=', 'data-url=');
|
||||
const msg = item.value.replace('href=', 'data-url=').replace(' ">', '">');
|
||||
|
||||
nrMessages = `${nrMessages}<div class="mui--bg-danger mui--text-white" style="padding:2px;">${msg}</div>`;
|
||||
}
|
||||
@ -233,7 +233,7 @@ ${nrMessages}
|
||||
<th class="mui--text-center">Status</th>
|
||||
<th class="mui--text-center">Platform</th></tr></thead>`;
|
||||
|
||||
ws = `${thead}${ws}</table>`;
|
||||
ws = `${thead}<tbody class="tableBody">${ws}</tbody></table>`;
|
||||
|
||||
this.$traintext.empty().html(ws);
|
||||
this.$traintext.removeClass('mui--hide').addClass('mui--show');
|
||||
|
@ -1,11 +1,14 @@
|
||||
const { promisify } = require('util');
|
||||
const jsonfile = require('jsonfile');
|
||||
const logger = require('log4js').getLogger();
|
||||
const lz77 = require('lz77');
|
||||
var lzw = require('json-lzw');
|
||||
|
||||
logger.level = 'trace';
|
||||
|
||||
const file = 'src/work/stations.json';
|
||||
const outFile = 'src/work/stationsMap.json';
|
||||
const file = '../src/work/stations.json';
|
||||
const outFile = '../src/work/stationsMap.json';
|
||||
const compressed = '../src/work/stations.lzw';
|
||||
|
||||
const readFile = promisify(jsonfile.readFile);
|
||||
const writeFile = promisify(jsonfile.writeFile);
|
||||
@ -14,15 +17,18 @@ function doConvert(obj) {
|
||||
const tempArray = [];
|
||||
for(const item of obj.locations)
|
||||
|
||||
if ((item.lat !== 0) && (item.long !== 0)) {
|
||||
// logger.debug(item.name);
|
||||
tempArray.push([item.crs, item.name]);
|
||||
}
|
||||
if ((item.lat !== 0) && (item.lon !== 0))
|
||||
// logger.debug(item.name);
|
||||
tempArray.push({ 'crs':item.crs, 'name':item.name, 'lat':item.lat, 'long':item.lon });
|
||||
|
||||
//const locMap = new Map(tempArray);
|
||||
// const locMap = new Map(tempArray);
|
||||
|
||||
// logger.debug(locMap);
|
||||
|
||||
const test = lz77.compress(JSON.stringify(tempArray), { 'minStringLength':3 });
|
||||
|
||||
console.log(test);
|
||||
|
||||
writeFile(outFile, tempArray)
|
||||
.then( () => {
|
||||
logger.debug('Saved...');
|
||||
|
Loading…
Reference in New Issue
Block a user