+ Events Page

This commit is contained in:
tmshv committed 2016-02-27 23:30:43 +03:00
1 parent 026a38dab1
commit 109dbbe44f
18 files changed
+166 -5

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import route from 'koa-route';
import {c} from '../core/db';
import {json} from './';
export default function (app) {
app.use(route.get('/events', json(
function *() {
let query = {};
this.body = yield c('events')
.find(query)
.toArray();
}
)));
app.use(route.get('/event/:event', json(
function *(event) {
this.body = yield c('events').findOne({id: event});
}
)));
};