MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / main

Function main

examples/context/src/configuration-injection.ts:36–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36export async function main() {
37 const ctx = new Context();
38
39 // Configure `greeter` with `{prefix: '>>>', includeDate: true}`
40 ctx
41 .configure<GreeterConfig>('greeter')
42 .to({prefix: '>>>', includeDate: true});
43 ctx.bind('greeter').toClass(Greeter);
44
45 const greeter = await ctx.get<Greeter>('greeter');
46 console.log(greeter.greet('Ray'));
47}
48
49if (require.main === module) {
50 main().catch(err => {

Callers 1

Calls 6

configureMethod · 0.95
bindMethod · 0.95
toMethod · 0.80
toClassMethod · 0.80
logMethod · 0.65
greetMethod · 0.65

Tested by

no test coverage detected