Update readmer
Fix tests and lint
get stack before call
Kick streamlines configuration of a robust, hardened, production-ready Go web
server. Its core is based on net/http
and standard library packages, and it
integrates proven, high-quality community Go packages for commonly-needed
additional features. It favors a data-driven, declarative approach to defining
a web server and its routes.
Through the use of the Builders
type, it provides some flexibility and
"pluggability" in the choice of third-party packages used to deliver those
extra features, but it is not the goal of this package to be fully customizable
The tests require a valid TLS certificate for localhost. The recommended approach is to use mkcert to create a local Certificate Authority and generate a locally-trusted certificate for localhost.
The following enviroment variables should be set:
KICK_TEST_LOCALHOST_CERT
should point to the localhost certificate file.KICK_TEST_LOCALHOST_KEY
should point to the localhost certificate key file.E.g.:
$ mkcert -cert-file ${KICK_TEST_LOCALHOST_CERT} -key-file ${KICK_TEST_LOCALHOST_KEY} localhost 127.0.0.1 ::1
Additionally, to use Go modules with Go 1.11+:
GO111MODULE=on
Then run the tests:
$ go test ./...
$ go test ./... -cover
$ go test ./... -race
Kick automatically builds a robust, DOS-hardened web server based on proven, established and widely used Go packages:
github.com/gorilla/handlers
for panic recovery, CORS, canonical host, content-type validation, method override, trust proxy headersgithub.com/gorilla/csrf
for CSRFgithub.com/julienschmidt/httprouter
for route multiplexinggolang.org/x/crypto/acme/autocert
for production TLS certificategithub.com/FiloSottile/mkcert
for localhost/development TLS certificategithub.com/juju/ratelimit
for absolute endpoint rate-limitinggithub.com/NYTimes/gziphandler
for gzip compressiongithub.com/felixge/httpsnoop
for wrapping http.ResponseWriter