summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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)
>^
dc5c070 ^

e6cbe9c ^
dc5c070 ^
f17e898 ^
e6cbe9c ^
7ab8c87 ^

d37d0f2 ^



b439892 ^
7ab8c87 ^
7e597ae ^
901b3ed ^
1076f2b

901b3ed ^
0c3544d ^
2b35fae ^

a3e3f0b ^

2b35fae ^
3e06ede ^
6f20315 ^
4aea423 ^
292ccc4 ^
d4b7a9a ^
10885d3 ^
1836b67 ^

7ab8c87 ^
1836b67 ^

7ab8c87 ^
2b35fae ^
72655f0 ^
df74b26 ^


72655f0 ^
df74b26 ^
7ab8c87 ^
72655f0 ^
df74b26 ^
7ab8c87 ^
3af6434 ^
df74b26 ^
a118a57 ^
9fb6502 ^
6499fc4 ^
2cce4b9 ^
6499fc4 ^
9066ee2 ^
2cce4b9 ^
9066ee2 ^
bab575c ^
1549faf ^
7ab8c87 ^

1549faf ^
bab575c ^
df74b26 ^
7ab8c87 ^

df74b26 ^
45aea23 ^
7ab8c87 ^
45aea23 ^
df74b26 ^
4aea423 ^
1549faf ^
bab575c ^
df74b26 ^
7ab8c87 ^

1549faf ^
bab575c ^
7ab8c87 ^
daae3bb ^
bab575c ^
3e06ede ^
7ab8c87 ^

4bb89e2 ^
df74b26 ^
7ab8c87 ^
2b35fae ^
0c3544d ^
0e5c819 ^
7ab8c87 ^
0e5c819 ^
4bd0d33 ^
a118a57 ^
4bd0d33 ^
0e5c819 ^
7ab8c87 ^
0c3544d ^
7ab8c87 ^
dc5c070 ^
4bb89e2 ^
60b3dce ^
7ab8c87 ^

4bb89e2 ^
7ab8c87 ^
5ef6ef1 ^

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