mirror of
https://github.com/imjasonh/go-gist
synced 2026-07-06 22:42:19 +00:00
Support new gist ID format
This commit is contained in:
parent
b11b696678
commit
6776724d9c
1 changed files with 4 additions and 4 deletions
8
app.go
8
app.go
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue