router.js
1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* 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(/^\/([\d]+)(.*)/, guangController.detail);
router.get('/tags/index', guangController.tags);
router.get('/tags/:query-p:page', guangController.tags); // tags 伪静态路由
router.get('/tags/:query', guangController.tags); // 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);
// seo-站点地图
router.get('/sitemap.xml', sitemap.guangMap);
module.exports = router;