aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-09-27 11:44:32 +0200
committerNoah Loomans <noahloomans@gmail.com>2017-09-27 11:44:32 +0200
commite39cdc33d17eeea21016e5991c7d4e3af369c90f (patch)
treeb6ce2c9307a94f02b7d7fa997f05038ec7c420db /src
parent63255f8cc3922ef267d9ec0bb69e4867da991a58 (diff)
Add jpg suppport
Diffstat (limited to 'src')
-rw-r--r--src/server/routes/getSchedule.js10
1 files changed, 10 insertions, 0 deletions
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