insaner
v1.4.2
Published
This package is an opinionated HTTP server built on top of the native NodeJS HTTP server.
Downloads
6
Readme
Insaner - Decidedly Opinionated Minimal NodeJS Http Server
This package is an opinionated HTTP server built on top of the native NodeJS HTTP server.
- No callbacks! Pure Promise bliss.
- There is a simple regexp-based router.
- Response object is not passed into request handlers, instead request handlers are expected to return a Response object.
- Request body consumption and parsing is done on-demand
similarly to the
fetch
Response, ie.await req.text()
andawait req.json()
; consumed raw body is cached, so multiple calls toreq.text()
andreq.json()
are possible (JSON parsing is done each time you callreq.json()
so that you can be sure you get the unmodified data, no matter what your middlewares do). - Also, cookies work out of the box.
- WebSocket compatible.
- Typings included.
Check out the GitHub repository for more information and docs.