Skip to content

Commit

Permalink
Support new gist ID format
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Jul 23, 2014
1 parent b11b696 commit 6776724
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app.go
Expand Up @@ -22,10 +22,10 @@ func init() {
w.Header().Set("Content-Type", "text/html")
w.Write([]byte(fmt.Sprintf(t, r.URL.Host+r.URL.Path, mux.Vars(r)["gistID"])))
}
r.HandleFunc("/{username}/{gistID:[0-9]+}/{package:[a-zA-Z0-9]+}", h).Methods("GET")
r.HandleFunc("/{username}/{gistID:[0-9]+}", h).Methods("GET")
r.HandleFunc("/{gistID:[0-9]+}/{package:[a-zA-Z0-9]+}", h).Methods("GET")
r.HandleFunc("/{gistID:[0-9]+}", h).Methods("GET")
r.HandleFunc("/{username}/{gistID:[0-9a-f]+}/{package:[a-zA-Z0-9]+}", h).Methods("GET")
r.HandleFunc("/{username}/{gistID:[0-9a-f]+}", h).Methods("GET")
r.HandleFunc("/{gistID:[0-9a-f]+}/{package:[a-zA-Z0-9]+}", h).Methods("GET")
r.HandleFunc("/{gistID:[0-9a-f]+}", h).Methods("GET")
r.Handle("/", http.RedirectHandler("https://github.com/ImJasonH/go-gist", http.StatusSeeOther))
http.Handle("/", r)
}

0 comments on commit 6776724

Please sign in to comment.