From 0fc26e54148374f2dd8aecb62af7193934631e69 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Sat, 23 Feb 2019 13:47:59 +0000 Subject: [PATCH] Initial README --- README.md | 23 +++++++++++++++++++++++ go.mod | 1 + 2 files changed, 24 insertions(+) create mode 100644 README.md create mode 100644 go.mod diff --git a/README.md b/README.md new file mode 100644 index 0000000..473ba0c --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# HTTP resource pack server + +A common scenario is that you have a set of static resources that you want to +server up quickly via HTTP (for example: stylesheets, WASM). + +This package provides a `net/http`-compatible `http.Handler` to do so, with +support for: +- compression + - gzip + - brotli, if you have the external compression binary available at pack time + - does not yet support Transfer-Encoding, only Accept-Encoding/Content-Encoding +- etags +- ranges + +The workflow is as follows: +- build YAML file describing files to serve +- run htpacker tool to produce a single .htpack file +- create `htpack.Handler` pointing at .htpack file + +Only the minimal header processing necessary for correctness (Content-Length, +etc.) is carried out by `htpack.Handler`; the handler can be combined with +middleware for further processing (adding headers, `http.StripPrefix`, etc.). + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f5d7be8 --- /dev/null +++ b/go.mod @@ -0,0 +1 @@ +module github.com/lwithers/htpack