Skip to content

PURISTA API


PURISTA API / @purista/k8s-sdk / addServiceEndpoints

Function: addServiceEndpoints()

addServiceEndpoints(services, app, logger, apiMountPath?): void

Defined in: addServiceEndpoints.impl.ts:42

Add HTTP endpoints for all commands that expose HTTP metadata.

This helper registers the routes on the provided Hono application and connects them with the corresponding service commands.

Parameters

services

Instance or array of services whose commands should be exposed.

Service<ServiceClassTypes> | Service<ServiceClassTypes>[] | undefined

app

Hono

The Hono application instance.

logger

Logger

Logger used for debug output.

apiMountPath?

string = '/api'

Base path for all generated endpoints. Defaults to /api.

Returns

void

Example

ts
const app = new Hono()
addServiceEndpoints(myService, app, logger)