forked from jimmykuu/gopher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.go
53 lines (44 loc) · 1.6 KB
/
urls.go
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
/*
URL和Handler的Mapping
*/
package main
import (
"net/http"
)
var (
handlers = map[string]func(http.ResponseWriter, *http.Request){
"/": indexHandler,
"/about": staticHandler("about.html"),
"/faq": staticHandler("faq.html"),
"/admin": adminHandler,
"/admin/nodes": adminListNodesHandler,
"/admin/node/new": adminNewNodeHandler,
"/admin/site_categories": adminListSiteCategoriesHandler,
"/admin/site_category/new": adminNewSiteCategoryHandler,
"/admin/users": adminListUsersHandler,
"/admin/user/{userId}/activate": adminActivateUserHandler,
"/signup": signupHandler,
"/signin": signinHandler,
"/signout": signoutHandler,
"/activate/{code}": activateHandler,
"/forgot_password": forgotPasswordHandler,
"/reset/{code}": resetPasswordHandler,
"/profile": profileHandler,
// "/profile/avatar": changeAvatarHandler,
"/nodes": nodesHandler,
"/go/{node}": topicInNodeHandler,
"/topic/new": newTopicHandler,
"/new/{node}": newTopicHandler,
"/t/{topicId}": showTopicHandler,
"/t/{topicId}/edit": editTopicHandler,
"/reply/{topicId}": replyHandler,
"/member/{username}": memberInfoHandler,
"/member/{username}/topics": memberTopicsHandler,
"/member/{username}/replies": memberRepliesHandler,
"/follow/{username}": followHandler,
"/unfollow/{username}": unfollowHandler,
"/sites": sitesHandler,
"/site/new": newSiteHandler,
"/site/{siteId}/edit": editSiteHandler,
}
)