router.js
923 Bytes
/**
* router of guang
* @author: lcy<chuanyang.liu@yoho.cn>
* @date: 2016/08/31
*/
'use strict';
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
const guangController = require(`${cRoot}/index`);
router.get('/', guangController.index);
router.get('/index/index', guangController.index);
router.get('/detail/:id', guangController.detail); // guang/info/index
router.get('/info/index', guangController.detail);
router.get('/tags/index', guangController.tags);
router.get('/Index/editor', guangController.editor);
// ajax
router.post('/info/comment', guangController.comment); // 添加评论
router.get('/info/praise', guangController.praise); // 点赞
router.get('/info/cancelPraise', guangController.cancelPraise);
router.get('/info/collect', guangController.collect);
router.get('/info/cancelCollect', guangController.cancelCollect);
module.exports = router;