data api with io

This commit is contained in:
tmshv committed 2016-03-23 19:38:59 +03:00
1 parent 0ffa403b60
commit aea2b8ff25
18 files changed
+162 -94

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
import {put} from 'koa-route';
import compose from 'koa-compose';
import {ensureServiceAuth} from '../../middlewares/ensureServiceAuth';
export function add() {
return put('/api/v1/feed', compose([
ensureServiceAuth(),
async ctx => {
let post = ctx.body;
ctx.body = {
pong: post
};
}
]));
}
-8
View File
@@ -1,8 +0,0 @@
import {add as feedAdd} from './feed';
import compose from 'koa-compose';
export default function () {
return compose([
feedAdd()
]);
};
+1 -1
View File
@@ -26,7 +26,7 @@ function list() {
ctx.type = 'application/json';
let pattern = toArray(ctx.query.sort || '');
let data = await c('collective').find();
let data = await c('collective').find().toArray();
if (!data) {
ctx.status = 404;
return;