infoscreens/server/route/calendar.js

11 lines
304 B
JavaScript
Raw Normal View History

2019-01-22 22:05:18 +01:00
require('isomorphic-fetch');
module.exports = (router) => {
router.get('/calendar', async (ctx) => {
const res = await fetch('https://www.c-base.org/calendar/exported/events.json');
ctx.assert((res.status === 200), res.status);
const body = await res.json();
ctx.body = body;
});
};