FUCKING BIG UPDATE: server, parallax, apis, new data models, style, layout, other

This commit is contained in:
tmshv committed 2016-03-03 01:34:45 +03:00
1 parent e0f54171a9
commit 359cc430f5
78 files changed
+1063 -445

No files matched your search

+10 -1
View File
@@ -1,14 +1,23 @@
import route from 'koa-route';
import {c} from '../core/db';
import {json} from './';
import {sortBy} from '../utils/sort';
export default function (app) {
let sortByDate = sortBy(
i => (new Date(i.date))
.getTime()
);
app.use(route.get('/events', json(
function *() {
let query = {};
this.body = yield c('events')
let events = yield c('events')
.find(query)
.toArray();
this.body = events
.sort(sortByDate);
}
)));