Compare commits
No commits in common. "d8d27991453cdd48164c56c02168074f2fc27876" and "bc23a976f93ce27c086d88ec4e7d82bf30be2e23" have entirely different histories.
d8d2799145
...
bc23a976f9
|
@ -1,3 +1,3 @@
|
|||
# What to do next:
|
||||
|
||||
* LDB to lookup and validate CRS or convert TIPLOC/STANOX to CRS before fetch.
|
||||
* Ensure existing 'meta' entries are updated and new entries aren't made.
|
|
@ -40,12 +40,5 @@ http {
|
|||
proxy_ignore_headers Cache-Control;
|
||||
proxy_cache_valid 200 1m;
|
||||
}
|
||||
|
||||
location /api/v1/list/ {
|
||||
proxy_pass http://localhost:8460;
|
||||
proxy_cache_key $scheme://$host$uri$is_args$query_string;
|
||||
proxy_ignore_headers Cache-Control;
|
||||
proxy_cache_valid 200 1440m;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,10 +75,9 @@ async function updateMeta(type, target, unixTime){
|
|||
|
||||
async function query(collection, query){
|
||||
await client.connect();
|
||||
var qcoll = db.collection(collection);
|
||||
var qcursor = qcoll.find(query)
|
||||
qcursor.project({_id: 0})
|
||||
var qresult = await qcursor.toArray();
|
||||
let qcoll = db.collection(collection);
|
||||
let qcursor = qcoll.find(query)
|
||||
let qresult = await qcursor.toArray();
|
||||
return qresult;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
// convertTiploc(TIPLOC) : Exported: Looks up CRS, Name & STANOX for Tiploc
|
||||
|
||||
const log = require('../utils/log.utils'); // Log Helper
|
||||
|
||||
const ldb = require('ldbs-json')
|
||||
const util = require('../utils/ldb.utils')
|
||||
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
const log = require('../utils/log.utils'); // Log Helper
|
||||
const db = require('../services/dbAccess.services')
|
||||
const corpus = require('../services/corpus.services');
|
||||
|
||||
async function getStations(){
|
||||
var out = await db.query("stations")
|
||||
log.out(`listServices.getStations: fetched stations list`)
|
||||
return out;
|
||||
// Databse lookup, get list of all stations as per the Python script output
|
||||
return {state:"No can do, not fully implemented."};
|
||||
}
|
||||
|
||||
async function getCorpus(){
|
||||
var out = await db.query("corpus")
|
||||
log.out(`listServices.getCorpus: fetched CORPUS list`)
|
||||
return out;
|
||||
// Raw corpus data, currently fetches from Network Rail each time its called
|
||||
return corpus.get();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Reference in New Issue