From 06f237314cdd96386db8626db8c697b8260aeac3 Mon Sep 17 00:00:00 2001 From: Jay Date: Fri, 17 Aug 2018 23:32:07 +0800 Subject: [PATCH] add check session api --- route/api/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/route/api/index.js b/route/api/index.js index 9c2a0fc..0bf8f0d 100644 --- a/route/api/index.js +++ b/route/api/index.js @@ -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