@kauai/body
v1.0.1
Published
Kauai body parser middleware
Downloads
5
Readme
@kauai/body
Kauai body parser middleware. Supports the following content types
application/json
application/x-www-form-urlencoded
plain/text
and any combination of the following encodings
br
x-gzip
gzip
deflate
Installation
npm install @kauai/body
Usage
import BodyParser from "@kauai/body";
class MyMiddleware extends Middleware {
public run(context: Context): void {
const { body } = context.request;
context.log.info("Body has been parsed (or not)", { body });
}
}
app.use("/deposit", new Router().post(new BodyParser(), new MyMiddleware()));
Test
npm run test:ci