MCPcopy Create free account
hub / github.com/middleapi/orpc / router

Method router

packages/nest/src/implement.test.ts:97–109  ·  view source on GitHub ↗
(@Req() _req: NodeHttpRequest)

Source from the content-addressed store, hash-verified

95 @Implement(contract)
96 @AdvanceMeta
97 router(@Req() _req: NodeHttpRequest) {
98 req = _req
99
100 return {
101 ping: implement(contract.ping).handler(ping_handler),
102 pong: lazy(() => Promise.resolve({ default: implement(contract.pong).handler(pong_handler) })),
103 nested: lazy(() => Promise.resolve({
104 default: {
105 peng: implement(contract.nested.peng).handler(peng_handler),
106 },
107 })),
108 }
109 }
110
111 /**
112 * Make sure the @Implement can prevent conflict method name

Callers

nothing calls this directly

Calls 3

implementFunction · 0.90
lazyFunction · 0.90
handlerMethod · 0.80

Tested by

no test coverage detected