data api with io
This commit is contained in:
1 parent
0ffa403b60
commit
aea2b8ff25
18 files changed
+162
-94
No files matched your search
@@ -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
|
||||
};
|
||||
}
|
||||
]));
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
import {add as feedAdd} from './feed';
|
||||
import compose from 'koa-compose';
|
||||
|
||||
export default function () {
|
||||
return compose([
|
||||
feedAdd()
|
||||
]);
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user