forked from cnodejs/nodeclub
-
Notifications
You must be signed in to change notification settings - Fork 5
/
routes.js
128 lines (108 loc) · 3.96 KB
/
routes.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*jslint node: true, regexp: true, nomen: true, indent: 2, vars: true */
/*!
* nodeclub - route.js
* Copyright(c) 2012 fengmk2 <[email protected]>
* MIT Licensed
*/
'use strict';
var sign = require('./controllers/sign');
var site = require('./controllers/site');
var user = require('./controllers/user');
var message = require('./controllers/message');
var tag = require('./controllers/tag');
var topic = require('./controllers/topic');
var reply = require('./controllers/reply');
var rss = require('./controllers/rss');
var upload = require('./controllers/upload');
var staticContent = require('./controllers/static');
var tools = require('./controllers/tools');
var status = require('./controllers/status');
var announcement = require('./controllers/announcement');
var facebook = require('./controllers/facebook');
var job = require('./controllers/job');
module.exports = function (app) {
// home page
app.get('/', site.index);
// announcement
app.get('/announcement', announcement.index);
// sign up, login, logout
app.get('/signup', sign.signup);
app.post('/signup', sign.signup);
app.get('/signout', sign.signout);
app.get('/signin', sign.showLogin);
app.post('/signin', sign.login);
app.get('/active_account', sign.active_account);
// password
app.get('/search_pass', sign.search_pass);
app.post('/search_pass', sign.search_pass);
app.get('/reset_pass', sign.reset_pass);
app.post('/reset_pass', sign.reset_pass);
// user
app.get('/user/:login', user.index);
app.get('/setting', user.setting);
app.post('/setting', user.setting);
app.get('/stars', user.show_stars);
app.get('/users/top100', user.top100);
app.get('/my/tags', user.get_collect_tags);
app.get('/my/topics', user.get_collect_topics);
app.get('/my/messages', message.index);
app.get('/my/follower', user.get_followers);
app.get('/my/following', user.get_followings);
app.get('/user/:login/topics', user.list_topics);
app.get('/user/:login/replies', user.list_replies);
app.post('/user/follow', user.follow);
app.post('/user/un_follow', user.un_follow);
app.post('/user/set_star', user.toggle_star);
app.post('/user/cancel_star', user.toggle_star);
// message
app.post('/messages/mark_read', message.mark_read);
app.post('/messages/mark_all_read', message.mark_all_read);
// tag
app.get('/tags/edit', tag.edit_tags);
app.get('/tag/:name', tag.list_topic);
app.get('/tag/:name/edit', tag.edit);
app.get('/tag/:name/delete', tag.delete);
app.post('/tag/add', tag.add);
app.post('/tag/:name/edit', tag.edit);
app.post('/tag/collect', tag.collect);
app.post('/tag/de_collect', tag.de_collect);
// topic
app.get('/topic/create', topic.create);
app.get('/topic/:tid', topic.index);
app.get('/t/:slug', topic.index);
app.get('/topic/:tid/top/:is_top?', topic.top);
app.get('/topic/:tid/edit', topic.edit);
app.post('/topic/:tid/delete', topic.delete);
app.post('/topic/create', topic.create);
app.post('/topic/:tid/edit', topic.edit);
app.post('/topic/collect', topic.collect);
app.post('/topic/de_collect', topic.de_collect);
app.get('/a/:slug', topic.slug);
// reply
app.post('/:topic_id/reply', reply.add);
app.post('/:topic_id/reply2', reply.add_reply2);
app.post('/reply/:reply_id/delete', reply.delete);
// upload
app.post('/upload/image', upload.uploadImage);
// tools
app.get('/site_tools', tools.run_site_tools);
// static
app.get('/about', staticContent.about);
app.get('/faq', staticContent.faq);
//rss
app.get('/rss', rss.index);
// site status
app.get('/status', status.status);
// facebook
app.get('/facebook/login', facebook.login);
app.get('/facebook/redirect', facebook.redirect);
// job
app.get('/job', job.index);
app.get('/job/create', job.create);
app.post('/job/create', job._create);
app.get('/job/:id', job.single);
app.get('/job/:id/edit', job.edit);
app.post('/job/:id/edit', job._edit);
app.get('/job/:id/delete', job.del);
app.post('/job/:id/delete', job._del);
};