Skip to content

Function: startServer()

ts
function startServer<TContext>(options): Promise<StartServerResult>;

Defined in: packages/core/src/server/startServer.ts:124

Start an Vurb server with a single call.

Handles all bootstrap boilerplate: Server creation, registry attachment, telemetry bus, and stdio transport connection.

Type Parameters

Type Parameter
TContext

Parameters

ParameterType
optionsStartServerOptions<TContext>

Returns

Promise<StartServerResult>

Example

typescript
import { startServer, autoDiscover } from '@vurb/core';

const registry = f.registry();
await autoDiscover(registry, new URL('./tools', import.meta.url));

await startServer({
    name: 'my-server',
    registry,
    contextFactory: () => createContext(),
});