router.js 542 Bytes
/**
 * 管理员router
 * @author: leo <qi.li@yoho.cn>
 * @date: 23/06/2017
 */
const express = require('express');
const router = express.Router();  // eslint-disable-line
const authAdmin = require('../../middleware/authAdmin');
const admin = require('./controllers/admin');

router.get('/', authAdmin, admin.indexPage);
router.get('/login', admin.loginPage);
router.post('/createActivity', authAdmin, admin.createActivity);

// Api
router.post('/api/login', admin.login);
router.post('/api/logout', admin.logout);

module.exports = router;