Elide Global

Elide installs an Elide global object exposing read-only build metadata and a programmatic server entry point.

Build metadata

Read-only properties describing the running binary:
PropertyDescription
Elide.versionElide version string.
Elide.debugWhether this is a debug build.
Elide.releaseWhether this is a release build.
Elide.buildModeBuild mode of the binary.
Elide.targetArchitectureTarget architecture the binary was built for.

Elide.serve(options)

Starts an HTTP server programmatically. options carries a fetch handler plus server settings such as port, hostname, cert, key, idleTimeoutMs, and maxBodyBytes, and returns a serve handle.

js
Elide.serve({
  port: 3000,
  fetch(request) {
    return new Response("hello");
  },
});

See also