Service bootstrap builders, health probes, and Hono/oRPC runtime wiring for NetScript
applications. This page is written against the package's public surface reported by deno doc.
For the full index of packages and plugins return to the
reference overview.
The package has three layers. Layer 1 exposes small primitives for health, error, RPC,
OpenAPI, and Scalar docs handlers. Layer 2 exposes createService(), a fluent builder
that materializes a mountable ServiceApp or starts a listener. Layer 3 exposes
defineService(), the preset used by generated service entrypoints.
The service router is always an input to the builder. build() returns a non-listening
ServiceApp, which keeps the RFC 14 unified-platform seam open for callers that mount
service apps into another host. serve() starts a Deno listener and returns a
RunningService handle with stop() for tests, local development, and process supervisors.
Public types are package-owned structural mirrors: callers do not need to import Hono or oRPC
types to describe a service surface. Runtime interoperability still uses the real Hono app and
oRPC handlers internally. LoggerMiddlewareOptions is re-exported from the sibling
@netscript/logger/middleware package because it is a first-party
@netscript/* contract, not an upstream vendor surface.
Builder and presets
Symbol
Signature
Description
createService
function createService<T extends ServiceRouter>(router: T, config: ServiceConfig): ServiceBuilder<T>
Factory function to create a new service builder.
defineService
async function defineService<T extends ServiceRouter>(router: T, options: DefineServiceOptions): Promise<RunningService>
One-liner preset for creating a fully-configured service.
Health primitives
Symbol
Signature
Description
createHealthHandler
function createHealthHandler(options?: HealthHandlerOptions): ServiceHandler
Creates a comprehensive health check handler that runs all checks in parallel.
createLivenessHandler
function createLivenessHandler(): ServiceHandler
Creates a simple liveness check handler.
createReadinessHandler
function createReadinessHandler(checks: Array<() => Promise<boolean>>): ServiceHandler
Creates a readiness check handler that runs multiple async checks.