diff --git a/src/routes/collective.js b/src/routes/collective.js new file mode 100644 index 00000000..9ea5d069 --- /dev/null +++ b/src/routes/collective.js @@ -0,0 +1,23 @@ +import route from 'koa-route'; +import {json} from './'; +import db from '../core/db'; +import {getCourseNameByID} from '../models/course'; +import team from '../models/team'; + +export default function (app) { + app.use( + route.get('/collective', json( + function *() { + this.type = 'application/json'; + + let data = yield db.c('collective').find(); + if (!data) { + this.status = 404; + return; + } + + this.body = data; + } + )) + ); +};