Bundled Middleware
Vox ships with a few middleware. Two of them are built into every application, and the others are optional packages in the same module.
| Middleware | Package | Purpose |
|---|---|---|
logging | built in | Prints an access log line for each request. |
respond | built in | Writes the status, headers and body to the client. |
| Static Files | github.com/aisk/vox/middlewares/static | Serves files from a local directory. |
| Pprof | github.com/aisk/vox/middlewares/pprof | Exposes Go's runtime profiling endpoints. |
The built-in middleware is described in the Middleware guide. To write your own, start with the same guide, and see Recipes for common examples.