// Get CORPUS data from Network Rail and format the data for OwlBoard // Username and password must be stored in `/srv/keys/owlboard/keys.config.js` const keys = require('/srv/keys/owlboard/keys.configs'); var https = require('https'); // Need to add auth header `Basic {BASE64 HASH OF user:pass} async function getCorpus(){ url = `https://datafeeds.networkrail.co.uk/ntrod/SupportingFileAuthenticate?type=CORPUS`; var request = https.request({'hostname': url}, function (response) { console.log('STATUS: ' + response.statusCode); console.log('HEADERS: ' + JSON.stringify(response.headers)); response.setEncoding('utf8'); response.on('data', function (chunk) { console.log('BODY: ' + chunk); }); }); request.end(); } async function cleanCorpus(){ } module.exports = { getCorpus }