Add proxy for c-base calendar json
This commit is contained in:
parent
2829b7984d
commit
a3120b1429
2 changed files with 12 additions and 0 deletions
|
@ -7,12 +7,14 @@ const path = require('path');
|
||||||
|
|
||||||
const routePictures = require('./route/pictures');
|
const routePictures = require('./route/pictures');
|
||||||
const route35c3 = require('./route/35c3');
|
const route35c3 = require('./route/35c3');
|
||||||
|
const routeCalendar = require('./route/calendar');
|
||||||
|
|
||||||
const app = new Koa();
|
const app = new Koa();
|
||||||
const router = new Router();
|
const router = new Router();
|
||||||
|
|
||||||
route35c3(router);
|
route35c3(router);
|
||||||
routePictures(router);
|
routePictures(router);
|
||||||
|
routeCalendar(router);
|
||||||
|
|
||||||
app
|
app
|
||||||
.use(Cors())
|
.use(Cors())
|
||||||
|
|
10
server/route/calendar.js
Normal file
10
server/route/calendar.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
};
|
Loading…
Reference in a new issue