mtfosbot/route/api/index.js
2018-08-14 14:17:48 +08:00

23 lines
379 B
JavaScript

const Router = require('koa-router')
const koaBody = require('koa-body')
const {
chkObject
} = require('@libs/route-utils')
const r = new Router()
r.use(async (c, n) => {
c.obj = {}
c.chkBody = chkObject.bind({body: c.request.body})
try {
await n()
} catch (err) {
console.log(err)
}
})
r.post('/login', koaBody(), async (c, n) => {
})
module.exports = r