WARNING: UNSTABLE API
Stackr is an extensible HTTP server framework for Go, shipping with over 5 bundled middleware and a poor selection of 3rd-party middleware.
package main
import "github.com/ricallinson/stackr"
func main() {
app := stackr.CreateServer()
app.Use(stackr.Logger())
app.Use(stackr.Static())
app.Use("/", func(req *stackr.Request, res *stackr.Response, next func()) {
res.End("hello world\n")
})
app.Listen(3000)
}
ErrorHandler
flexible error handlerFavicon
efficient favicon serverLogger
request logger with custom format supportResponseTime
calculates response-time and exposes via X-Response-TimeMethodOverride
faux HTTP method supportStatic
static file server currently based on http.FileServer
The following should all be executed from the stackr
directory $GOPATH/src/github.com/ricallinson/stackr/.
go get github.com/ricallinson/simplebdd
go test
go get github.com/axw/gocov/gocov
go get -u github.com/matm/gocov-html
gocov test | gocov-html > ./reports/coverage.html
This project started out as a clone of the superb Node.js library Connect.