summary refs log tree commit diff stats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.go b/main.go
index 25d95af..bca7847 100644
--- a/main.go
+++ b/main.go
@@ -14,6 +14,9 @@ const getwtxt = "0.1"
 
 func main() {
 
+	// StrictSlash(true) allows /api and /api/
+	// to serve the same content without duplicating
+	// handlers/paths
 	index := mux.NewRouter().StrictSlash(true)
 	api := index.PathPrefix("/api").Subrouter()
 
@@ -24,9 +27,6 @@ func main() {
 	index.Path("/api").
 		Methods("GET").
 		HandlerFunc(apiBaseHandler)
-	api.Path("/").
-		Methods("GET").
-		HandlerFunc(apiBaseHandler)
 	// twtxt will add support for other formats later.
 	// Maybe json? Making this future-proof.
 	api.Path("/{format:(?:plain)}").
@@ -48,9 +48,11 @@ func main() {
 		Queries("url", "{url}", "nickname", "{nickname:[a-zA-Z0-9]+}").
 		Methods("POST").
 		HandlerFunc(apiEndpointPOSTHandler)
+	// Show all observed tags
 	api.Path("/{format:(?:plain)}/tags").
 		Methods("GET").
 		HandlerFunc(apiTagsBaseHandler)
+	// Requests tweets with a specific tag
 	api.Path("/{format:(?:plain)}/tags/{tags:[a-zA-Z0-9]+}").
 		Methods("GET").
 		HandlerFunc(apiTagsHandler)
vc@akkartik.com> 2015-08-06 19:15:57 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-08-06 19:15:57 -0700 1949' href='/akkartik/mu/commit/html/048typecheck.cc.html?h=main&id=eaeb955212eb3b133fd98d98457f17bfea8891d1'>eaeb9552 ^
9570363a ^
eaeb9552 ^
9570363a ^
eaeb9552 ^
9570363a ^


eaeb9552 ^
9570363a ^





eaeb9552 ^


9570363a ^
eaeb9552 ^


9570363a ^
eaeb9552 ^
9570363a ^




eaeb9552 ^

9570363a ^


eaeb9552 ^


9570363a ^

4fe9f5e8 ^

9570363a ^



eaeb9552 ^
9570363a ^




eaeb9552 ^
9570363a ^







eaeb9552 ^
9570363a ^

4fe9f5e8 ^



eaeb9552 ^
4fe9f5e8 ^


9570363a ^



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
129