[site] updated

This commit is contained in:
tmshv committed 2017-01-03 06:31:02 +03:00
1 parent e9ac51d675
commit d5db0ca07e
4 files changed
+40 -33

No files matched your search

+9 -1
View File
@@ -8,14 +8,22 @@ async function exists(ctx, id) {
return Boolean(i)
}
export default function () {
export default function (store) {
return compose([
docs(store),
documents(),
document(),
type()
])
}
function docs(store) {
return route.get('/docs', async ctx => {
const docs = await store.document.find({})
ctx.body = docs
})
}
function documents() {
return route.get('/documents', json(
async(ctx) => {
+2 -2
View File
@@ -20,14 +20,14 @@ import pages from './pages';
let main = () => route.get('/', index());
export function routes() {
export function routes(store) {
return compose([
main(),
sitemap(),
schedule(),
news(),
gallery(),
documents(),
documents(store),
teachers(),
events(),
articles(),