Simple HTTP router for Go
Run this command with correctly configured Go toolchain.
go get github.com/ngamux/ngamux
package main
import(
"net/http"
"github.com/ngamux/ngamux"
)
func main() {
mux := ngamux.New()
mux.Get("/", func(rw http.ResponseWriter, r *http.Request) error {
return ngamux.JSON(rw, ngamux.Map{
"message": "welcome!",
})
})
http.ListenAndServe(":8080", mux)
}
See more examples!
This project is licensed under the Mozilla Public License 2.0.
Thanks to all contributors!