diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-05-11 04:40:29 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-05-11 04:40:29 -0400 |
commit | bd2800a976bb61a5d1e67c084597116f5edc5a08 (patch) | |
tree | 02855b7980fb3c9d26bfb700cc2e400ee797d1b1 /main.go | |
parent | c87acad59c4436554e60ab14870b77e49046c84a (diff) | |
download | getwtxt-bd2800a976bb61a5d1e67c084597116f5edc5a08.tar.gz |
query vars to endpoint in routing
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go index 9cc1337..453426a 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,9 @@ func main() { index.HandleFunc("/", indexHandler) api.HandleFunc("/", apiBaseHandler) api.HandleFunc("/{format:(?:plain)}", apiFormatHandler) - api.HandleFunc("/{format:(?:plain)}/{endpoint:(?:mentions|users|tweets)}", apiEndpointHandler) + api.Path("/{format:(?:plain)}/{endpoint:(?:mentions|users|tweets)}"). + Queries("url", "{url}", "q", "{query}", "nickname", "{nickname}"). + HandlerFunc(apiEndpointHandler) api.HandleFunc("/{format:(?:plain)}/tags", apiTagsBaseHandler) api.HandleFunc("/{format:(?:plain)}/tags/{tags:[a-zA-Z0-9]+}", apiTagsHandler) |