router.js 1.03 KB
/**
 * 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(['/', '/index/index'], guangController.index);
router.get(['/detail/:id', '/info/index'], guangController.detail);  // guang/info/index
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);

router.get('/info/listData', guangController.listDynamicData);
router.get('/info/detailData', guangController.detailDynamicData);

// router.get('/info/commentData', guangController.detailCommentData);

module.exports = router;