This repository has been archived on 2023-08-24. You can view files and clone it, but cannot push or open issues or pull requests.
OwlBoard/src/services/list.services.js
Fred Boniface be745978bb FullStack: Expand stats page
Signed-off-by: Fred Boniface <fred@fjla.uk>
2023-02-02 18:50:47 +00:00

30 lines
734 B
JavaScript

const log = require('../utils/log.utils'); // Log Helper
const db = require('../services/dbAccess.services')
const os = require('os')
async function getStations(){
var out = await db.query("stations")
log.out(`listServices.getStations: fetched stations list`)
return out;
}
async function getCorpus(){
var out = await db.query("corpus")
log.out(`listServices.getCorpus: fetched CORPUS list`)
return out;
}
async function hits(){
var dat = await db.query("meta", {target: "counters"});
log.out(`listServices.meta: fetched server meta`)
let out = {}
out.host = os.hostname()
out.dat = dat
return out;
}
module.exports = {
getStations,
getCorpus,
hits
}