diff --git a/src/routes/pages.js b/src/routes/pages.js index f6cec2fc..eb2f671c 100644 --- a/src/routes/pages.js +++ b/src/routes/pages.js @@ -1,14 +1,14 @@ -import route from 'koa-route'; -import {c} from '../core/db'; -import {accepts, index} from './'; +import route from 'koa-route' +import {c} from '../core/db' +import {accepts, index} from './' async function exists(ctx) { - const page = await getPage(ctx.path); - return Boolean(page); + const page = await getPage(ctx.path) + return Boolean(page) } async function getPage(path) { - return await c('pages').findOne({url: path}); + return await c('pages').findOne({url: path}) } export default function () { @@ -16,9 +16,9 @@ export default function () { 'text/html': index(exists), 'text/plain': index(exists), 'application/json': async(ctx) => { - const page = await getPage(ctx.path); - if (!page) ctx.status = 404; - else ctx.body = page; + const page = await getPage(ctx.path) + if (!page) ctx.status = 404 + else ctx.body = page } })) };