Nyora (JavaScript) - v0.1.1
    Preparing search index...

    Class NyoraServer

    Serve the camelCase helper REST contract over an embedded runtime.

    Exposes the Nyora helper REST API backed by a ParserRuntime, so any Nyora client can talk to the JS SDK as if it were the JVM helper.

    const server = new NyoraServer();
    const baseUrl = await server.start(); // background, returns the URL
    // ... attach a client to baseUrl ...
    await server.stop();
    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Initialize the server.

      Parameters

      • options: {
            host?: string;
            port?: number;
            runtime?: ServerRuntime;
            writePortFile?: boolean;
        } = {}

        Server options.

        • Optionalhost?: string

          Interface to bind. Defaults to loopback.

        • Optionalport?: number

          Port to bind, or 0 to pick a free ephemeral port.

        • Optionalruntime?: ServerRuntime

          An existing runtime to serve. When omitted, a new ParserRuntime is created and owned (closed on stop).

        • OptionalwritePortFile?: boolean

          Whether to write the bound port to the standard helper port file so other apps can discover this server. Defaults to true.

      Returns NyoraServer

    Accessors

    • get baseUrl(): string

      The base URL the server is bound to.

      Returns string

      The http://host:port base URL.

      NyoraError If the server has not been started yet.

    Methods

    • Start serving in the background.

      Idempotent: calling it again while running resolves to the existing URL.

      Returns Promise<string>

      The base URL the server is bound to.

    • Stop the server and release its resources.

      Closes the listening socket and closes an owned runtime. Safe to call when not running.

      Returns Promise<void>