MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / createBodyParserBinding

Function createBodyParserBinding

packages/rest/src/rest.server.ts:1079–1089  ·  view source on GitHub ↗
(
  parserClass: Constructor<BodyParser>,
  key?: BindingAddress<BodyParser>,
)

Source from the content-addressed store, hash-verified

1077 * @param key - Optional binding address
1078 */
1079export function createBodyParserBinding(
1080 parserClass: Constructor<BodyParser>,
1081 key?: BindingAddress<BodyParser>,
1082): Binding<BodyParser> {
1083 const address =
1084 key ?? `${RestBindings.REQUEST_BODY_PARSER}.${parserClass.name}`;
1085 return Binding.bind<BodyParser>(address)
1086 .toClass(parserClass)
1087 .inScope(BindingScope.TRANSIENT)
1088 .tag(REQUEST_BODY_PARSER_TAG);
1089}
1090
1091/**
1092 * The form of OpenAPI specs to be served

Callers 5

RestComponentClass · 0.90
bodyParserMethod · 0.85
givenHandlerFunction · 0.85

Calls 4

tagMethod · 0.80
inScopeMethod · 0.80
toClassMethod · 0.80
bindMethod · 0.45

Tested by 1

givenHandlerFunction · 0.68