Reinventing the net/http
compatible wheel.
This project took inspiration from go-chi/chi
while embracing the latest features of net/http
.
- HTTP request method handling
- Middlewares
see examples for more details
package main
import (
"fmt"
"net/http"
"github.com/lemredd/gohttp/v0"
)
var PORT = fmt.Sprintf(":%v", 8080)
func main() {
mux := gohttp.NewMux()
mux.HandleFunc("GET /{$}", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello World!"))
})
fmt.Printf("Listening on port %v\n", PORT)
http.ListenAndServe(PORT, mux)
}
Items in this list will be appended to features section.