+ Events Page
This commit is contained in:
1 parent
026a38dab1
commit
109dbbe44f
18 files changed
+166
-5
No files matched your search
@@ -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});
|
||||
}
|
||||
)));
|
||||
};
|
||||
Reference in new issue
Block a user