Skip to content

start

start(mainApiFile, opts?): Promise<void>

Defined in: server.ts:494

Starts the Lowlander WebSocket server.

string

Absolute path to the compiled API file exporting server functions

string

Address and port (default: ‘0.0.0.0:8080’)

number

Worker thread count (default: auto)

any

For testing: inject a custom WarpSocket implementation (e.g. FakeWarpSocket)

Promise<void>

import { start } from 'lowlander/server';
import { fileURLToPath } from 'url';
import { resolve, dirname } from 'path';
const API_FILE = resolve(dirname(fileURLToPath(import.meta.url)), 'api.js');
start(API_FILE, { bind: '0.0.0.0:8080' });