aboutsummaryrefslogtreecommitdiff
path: root/src/server/routes/getSchedule.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-02-07 16:04:31 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-02-07 16:04:31 +0100
commit074b6e3cc6ce3917459175ebc7481b58d3ca728f (patch)
treed9d8859abaefceb419ca937c56b76ab633023c4d /src/server/routes/getSchedule.js
parent5ebd34ed83f878976b89da78d6bdaa1dc9e935d7 (diff)
Fix the backend
Diffstat (limited to 'src/server/routes/getSchedule.js')
-rw-r--r--src/server/routes/getSchedule.js15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/server/routes/getSchedule.js b/src/server/routes/getSchedule.js
index f6bc256..5e9bb29 100644
--- a/src/server/routes/getSchedule.js
+++ b/src/server/routes/getSchedule.js
@@ -3,9 +3,8 @@ const express = require('express');
const router = express.Router();
const request = require('request');
const iconv = require('iconv-lite');
-const webshot = require('webshot');
-const getUserIndex = require('../lib/getUserIndex');
+const getMeetingpointData = require('../lib/getMeetingpointData');
const getURLOfUser = require('../lib/getURLOfUser');
// copied from http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/untisscripts.js,
@@ -25,18 +24,8 @@ function getWeekNumber(target) {
return 1 + Math.ceil((firstThursday - target) / 604800000);
}
-// router.get('/:type/:value.png', (req, res) => {
-// const port = process.env.PORT || 3000;
-// const { type, value } = req.params;
-// const stream = webshot(
-// `http://localhost:${port}/get/${type}/${value}`,
-// { customCSS: 'body { background-color: white; }' },
-// );
-// stream.pipe(res);
-// });
-
router.get('/:type/:value', (req, res, next) => {
- getUserIndex().then((users) => {
+ getMeetingpointData().then(({ users }) => {
const { type, value } = req.params;
let { week } = req.query;
const user =