add check session api
This commit is contained in:
parent
3a08cbb1fb
commit
06f237314c
@ -4,7 +4,8 @@ const {
|
|||||||
chkObject,
|
chkObject,
|
||||||
resObject,
|
resObject,
|
||||||
APIError,
|
APIError,
|
||||||
genError
|
genError,
|
||||||
|
checkSession
|
||||||
} = require('@libs/route-utils')
|
} = require('@libs/route-utils')
|
||||||
const DB = require('@libs/database')
|
const DB = require('@libs/database')
|
||||||
const r = new Router()
|
const r = new Router()
|
||||||
@ -54,6 +55,10 @@ r.post('/login', koaBody(), async (c, n) => {
|
|||||||
c.obj = resObject('Success')
|
c.obj = resObject('Success')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
r.get('/session', checkSession, async (c, n) => {
|
||||||
|
c.obj = resObject('Success')
|
||||||
|
})
|
||||||
|
|
||||||
r.use('/twitch', require('./twitch').routes())
|
r.use('/twitch', require('./twitch').routes())
|
||||||
|
|
||||||
module.exports = r
|
module.exports = r
|
||||||
|
Loading…
Reference in New Issue
Block a user