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/getURLOfUser.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/getURLOfUser.js (limited to 'lib/getURLOfUser.js') diff --git a/lib/getURLOfUser.js b/lib/getURLOfUser.js new file mode 100644 index 0000000..2de48e6 --- /dev/null +++ b/lib/getURLOfUser.js @@ -0,0 +1,8 @@ +const leftPad = require('left-pad') // I imported this just to piss you off ;) + +function getURLOfUser (type, index, week) { + return `http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/` + + `${leftPad(week, 2, '0')}/${type}/${type}${leftPad(index + 1, 5, '0')}.htm` +} + +module.exports = getURLOfUser -- cgit v1.1