-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathmap.js
More file actions
35 lines (27 loc) · 1.01 KB
/
map.js
File metadata and controls
35 lines (27 loc) · 1.01 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
var site = require('./routes/index'), user = require('./routes/user'), post = require('./routes/post');
var config = require('./config').config;
module.exports = function(app) {
app.get('/', site.index);
app.get('/about-me', site.about);
app.get('/site/login', user.login);
app.post('/site/login', user.login);
app.get('/experiment', site.experiment);
// post页面
app.get('/post', post.index);
// ajax 交互请求
app.post('/comment/add', post.addComment);
app.post('/comment/approve', post.approveComment);
// 文章发布
var publishUrl = config.site.ARTICLE_PUBLISH_URL;
app.post(publishUrl, post.publishPost);
app.get(publishUrl, post.publishPost);
// 删除文章
app.get('/post/remove', post.delPost);
app.post('/post/remove', post.delPost);
// 获取当前网站的基本信息
app.get('/site/status', site.status);
app.post('/site/status', site.status);
// 过滤到404页面
if (process.env.NODE_ENV == 'production')
app.get('*', site.notfound);
};