redirect.go 217 B

1234567891011
  1. package redirect
  2. import (
  3. "net/http"
  4. )
  5. func Handler(url string) http.Handler {
  6. return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
  7. http.Redirect(w, r, url, http.StatusTemporaryRedirect)
  8. })
  9. }