forked from lukeddy/tuer.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wapRoutes.js
66 lines (52 loc) · 1.91 KB
/
wapRoutes.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var config = require('./lib/config'),
index = require('./routes/wap/index'),
diary = require('./routes/wap/diary'),
set = require('./routes/wap/set'),
register = require('./routes/wap/register'),
comment = require('./routes/wap/comment'),
error = require('./routes/wap/error'),
user = require('./routes/wap/user'),
GoogleAnalytics = require('ga'),
UA = "UA-33569930-1",
Host = "m.tuer.me",
login = require('./routes/wap/login');
module.exports = function(app) {
app.redirect('json_error','/500');
app.redirect('404','/404');
app.redirect('500','/500');
var ga = new GoogleAnalytics(UA,Host);
app.get('*',function(req,res,next){
ga.trackPage(req.url);
if(!req.accepts("html") && req.accepts("application/xhtml+xml")){
res.charset = 'UTF-8';
res.header('Content-Type', 'application/xhtml+xml');
}
next();
});
app.post('/login',login.signin);
app.get('/logout',login.logout);
app.get('*',login.cookies);
app.get('/',index.index);
app.get('/index',index.index);
app.get('/register',register.index);
app.post('/register/invite', register.invite);
app.get('/register/active/:active', register.active);
app.get('/profile/:id',user.profile);
app.get('/profile/:uid/diaries/:page?',user.diaries);
app.get('/diary/:id',diary.detail);
app.get('/diaries/:page?',diary.list);
app.get('/diary/write',diary.write);
app.get('/diary/edit/:id',diary.edit);
app.post('/diary/save',diary.save);
app.post('/diary/update',diary.update);
app.post('/diary/remove',diary.remove);
app.post('/comment/save',comment.save);
app.post('/comment/remove',comment.remove);
app.get('/set',set.index);
app.get('/set/pwd',set.pwd);
app.post('/set/update',set.update);
app.post('/set/pwdSave',set.pwdSave);
app.get('/404',error.notFound);
app.get('/500',error.proError);
app.get('*',error.notfound);
};