Documentation
¶
Overview ¶
Package router provides an http.Handler implementation with a nice API for registering routes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is a wrapper around an http.ServeMux that provides a slightly nicer API for registering routes.
func (Router) GET ¶
func (router Router) GET(path string, h http.HandlerFunc)
GET registers a route at the provided path that responds to GET requests.
func (Router) POST ¶
func (router Router) POST(path string, h http.HandlerFunc)
POST registers a route at the provided path that responds to POST requests.
func (Router) ServeFiles ¶
ServeFiles serves static files located in `dir` and accessed via requests whose path starts with `prefix`.
Click to show internal directories.
Click to hide internal directories.