add check session api

This commit is contained in:
Jay 2018-08-17 23:32:07 +08:00
parent 3a08cbb1fb
commit 06f237314c

View File

@ -4,7 +4,8 @@ const {
chkObject,
resObject,
APIError,
genError
genError,
checkSession
} = require('@libs/route-utils')
const DB = require('@libs/database')
const r = new Router()
@ -54,6 +55,10 @@ r.post('/login', koaBody(), async (c, n) => {
c.obj = resObject('Success')
})
r.get('/session', checkSession, async (c, n) => {
c.obj = resObject('Success')
})
r.use('/twitch', require('./twitch').routes())
module.exports = r