|Feb 17, 2021
|Feb 12, 2021
|Jan 15, 2021
|Jan 15, 2021
#585 in HTTP server
50 downloads per month
Our design goals:
- Make all return values from route handlers and middlewares be valid responses, mapping to http semantics.
- Prefer zero-cost abstractions: pay for what you use and nothing more, including in installation and startup time.
- Use global types, no special response types.
- Only modify objects we provide; do not rely on modifications to node's request & response objects.
- Provide pluggable behavior for body-parsing and middleware, with good defaults.
- Use only minimal, well-vetted dependencies.
- Bake in observability (optionally), via Honeycomb tracing.
- Rely on a little bit of documented convention to avoid configuration.
- Making throwing Boltzmann away if you need to move on possible.
For full Boltzmann docs, visit the documentation site.
If you prefer to look at working example code, we've provided examples in the
./examples directory of this repo.
To scaffold a new service with Boltzmann, run the
boltzmann command-line tool. You can get it from the releases page or run it via
npx boltzmann-cli. (We prebuild for Mac OS, Windows, and GNU Linuxes.) The tool is responsible for initializing a new Boltzmann project as well as keeping it up to date. You enable or disable specific Boltzmann features using the tool.
For example, to scaffold with the defaults:
projects|⇒ npx boltzmann-cli hello
A complete project is provided for you, with useful package run scripts and linting. To run:
./boltzmann.js. And to view the response:
curl http://localhost:5000/hello/world. Want to know more? Check the docs!