-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathroutes.js
51 lines (40 loc) · 1.78 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
/**
* User: willerce
* Date: 7/30/12
* Time: 12:23 AM
*/
var blog = require('./routes/blog');
var admin = require('./routes/admin');
module.exports = function (app) {
app.get('/', blog.index);
app.get('/post/:slug', blog.post);
app.get(/^\/p\/(\d+)$/, blog.index);
app.get('/feed', blog.feed);
app.get('/archives', blog.archives);
app.get('/page/:slug', blog.page);
app.post('/comment', blog.comment);
app.get('/tag/:tag', blog.tag);
/* admin */
app.get('/admin', admin.auth_user, admin.index);
app.get('/admin/install', admin.install);
app.post('/admin/install', admin.install);
app.get('/admin/login', admin.login);
app.post('/admin/login', admin.login);
app.get('/admin/logout', admin.auth_user, admin.logout);
app.get('/admin/post', admin.auth_user, admin.postIndex);
app.get('/admin/post/write', admin.auth_user, admin.postWrite);
app.post('/admin/post/write', admin.auth_user, admin.postWrite);
app.get('/admin/post/edit/:slug', admin.auth_user, admin.postEdit);
app.post('/admin/post/edit/:slug', admin.auth_user, admin.postEdit);
app.post('/admin/post/delete/:slug', admin.auth_user, admin.postDelete);
app.get('/admin/page', admin.auth_user, admin.pageIndex);
app.get('/admin/page/write', admin.auth_user, admin.pageWrite);
app.post('/admin/page/write', admin.auth_user, admin.pageWrite);
app.get('/admin/page/edit/:slug', admin.auth_user, admin.pageEdit);
app.post('/admin/page/edit/:slug', admin.auth_user, admin.pageEdit);
app.get('/admin/comment', admin.auth_user, admin.commentIndex);
app.get('/admin/comment/delete/:id', admin.auth_user, admin.commentDelete);
app.get('/admin/verifyAkismet', admin.auth_user, admin.verifyAkismet);
app.get('/admin/submitSpam/:id', admin.auth_user, admin.submitSpam);
app.get('*', blog.pageNotFound);
};