Browse Source

Update README.md

Volodymyr Tkach 2 years ago
parent
commit
8542563537
1 changed files with 17 additions and 0 deletions
  1. 17 0
      README.md

+ 17 - 0
README.md

@@ -194,8 +194,25 @@ func main() {
 }
 ```
 
+## utils/http/redirect
+
 HTTP request redirect helper:
 
 ```go
 func redirect.Handler(url string) http.Handler
 ```
+
+```go
+// Example:
+mux.Get("/old", redirect.Handler("/new"))
+```
+
+## utils/http/render
+
+Used for rendering HTML pages and for JSON API responses
+
+```go
+func HTML(w http.ResponseWriter, r *http.Request, f template.FuncMap, d interface{}, s string, httpStatusCode int) bool
+func JSON(w http.ResponseWriter, r *http.Request, o interface{}) bool
+```
+