From e39cdc33d17eeea21016e5991c7d4e3af369c90f Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Wed, 27 Sep 2017 11:44:32 +0200 Subject: Add jpg suppport --- src/server/routes/getSchedule.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/server') diff --git a/src/server/routes/getSchedule.js b/src/server/routes/getSchedule.js index cb7ad67..7850918 100644 --- a/src/server/routes/getSchedule.js +++ b/src/server/routes/getSchedule.js @@ -32,6 +32,16 @@ router.get('/:type/:value.png', function (req, res, next) { stream.pipe(res) }) +router.get('/:type/:value.jpg', function (req, res, next) { + port = process.env.PORT || 3000; + const { type, value } = req.params + const stream = webshot( + `http://localhost:${port}/get/${type}/${value}`, + { customCSS: "body { background-color: white; }", streamType: 'jpg' } + ) + stream.pipe(res) +}) + router.get('/:type/:value', function (req, res, next) { getUserIndex().then(users => { const { type, value } = req.params -- cgit v1.1