Skip to content

Connectum API Reference / @connectum/core / types / ProtocolRegistration

Interface: ProtocolRegistration

Defined in: packages/core/src/types.ts:84

Protocol registration interface

Protocols (healthcheck, reflection, custom) implement this interface to register themselves on the server's ConnectRouter.

Example

typescript
const myProtocol: ProtocolRegistration = {
  name: "my-protocol",
  register(router, context) {
    router.service(MyService, myImpl);
  },
};

const server = createServer({
  services: [routes],
  protocols: [myProtocol],
});

Properties

httpHandler?

optional httpHandler?: HttpHandler

Defined in: packages/core/src/types.ts:92

Optional HTTP handler for fallback routing (e.g., /healthz endpoint)


name

readonly name: string

Defined in: packages/core/src/types.ts:86

Protocol name for identification (e.g., "healthcheck", "reflection")

Methods

register()

register(router, context): void

Defined in: packages/core/src/types.ts:89

Register protocol services on the router

Parameters

router

ConnectRouter

context

ProtocolContext

Returns

void