router.js
1.16 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`);
const sitemap = require('../3party/controllers/sitemap');
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);
// guang站点地图
router.get('/sitemap.xml', sitemap.siteMap);
module.exports = router;