Categorygithub.com/mwildt/go-http
repositorypackage
1.3.0
Repository: https://github.com/mwildt/go-http.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

mwildt/go-http

This is a simple utility-package for handling http requests.

Router

func main() {
    router := routing.NewRouter(func(router routing.Routing) {

        router.Handle(
            routing.Path("/api/**"),
            httputil.NewSingleHostReverseProxy(serviceLocation))

        router.Handle(
            routing.Path("/**").Method("GET"),
            http.FileServer(http.Dir("/static/")))

    })

    err = http.ListenAndServe(":8080", router)
}