Page Contents
Home > @loopback/rest > RestServer > bodyParser
RestServer.bodyParser() method
Bind a body parser to the server context
Signature:
bodyParser(bodyParserClass: Constructor<BodyParser>, address?: BindingAddress<BodyParser>): Binding<BodyParser>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| bodyParserClass | [Constructor](/doc/en/lb4/apidocs.context.constructor.html)<[BodyParser](/doc/en/lb4/apidocs.rest.bodyparser.html)> | |
| address | [BindingAddress](/doc/en/lb4/apidocs.context.bindingaddress.html)<[BodyParser](/doc/en/lb4/apidocs.rest.bodyparser.html)> | _(Optional)_ Optional binding address |
Returns: