From 69406c43ea899c3956aa16a9e0834aff40c8510f Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sat, 27 May 2017 11:44:07 +0200 Subject: Rewrite /meetingpointProxy into /get This makes it simple and more secure, and this improves server logging. --- lib/getUserIndex.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/getUserIndex.js') diff --git a/lib/getUserIndex.js b/lib/getUserIndex.js index cf409c0..db7daa8 100644 --- a/lib/getUserIndex.js +++ b/lib/getUserIndex.js @@ -9,7 +9,7 @@ let lastUpdate function updateUserIndex () { return new Promise(function (resolve, reject) { - console.log('Updating user index...') + process.stdout.write('Updating user index... ') request(`http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/frames/navbar.htm`) .then(function (page) { lastUpdate = new Date() @@ -56,9 +56,14 @@ function updateUserIndex () { } }))) + process.stdout.write('done.\n') + resolve(userIndex) }) - .catch(error => { reject(error) }) + .catch(error => { + process.stdout.write('failed.\n') + reject(error) + }) }) } -- cgit v1.1