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:| Property | Description |
|---|---|
Elide.version | Elide version string. |
Elide.debug | Whether this is a debug build. |
Elide.release | Whether this is a release build. |
Elide.buildMode | Build mode of the binary. |
Elide.targetArchitecture | Target 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
elide servein the CLI reference