diff --git a/server/index.js b/server/index.js index 8714466..e66281e 100644 --- a/server/index.js +++ b/server/index.js @@ -4,9 +4,13 @@ const Static = require('koa-static'); const Cors = require('koa-cors'); const path = require('path'); +const route35c3 = require('./route/35c3'); + const app = new Koa(); const router = new Router(); +route35c3(router); + app .use(Cors()) .use(router.routes()) diff --git a/server/route/35c3.js b/server/route/35c3.js new file mode 100644 index 0000000..288bcef --- /dev/null +++ b/server/route/35c3.js @@ -0,0 +1,10 @@ +require('isomorphic-fetch'); + +module.exports = (router) => { + router.get('/35c3/fahrplan', async (ctx) => { + const res = await fetch('https://fahrplan.events.ccc.de/congress/2018/Fahrplan/schedule.json'); + ctx.assert((res.status === 200), res.status); + const body = await res.json(); + ctx.body = body; + }); +};