The Elide global exposes metadata for the running binary:
| Property | Type |
|---|---|
version | string |
debug | boolean |
release | boolean |
buildMode | string |
targetArchitecture | string |
console.log(Elide.version, Elide.buildMode);Elide.serve(options)
Elide.serve accepts a Fetch-style handler and returns an object with port,
hostname, and close():
const server = Elide.serve({
port: 3000,
hostname: "127.0.0.1",
fetch() {
return new Response("hello");
},
});
console.log(server.port, server.hostname);In Elide 1.5.0, this handle does not keep a one-shot script alive by itself.
Use elide serve for a long-running service.
Request and response bodies stream incrementally. A handler can read
request.body as chunks arrive and return a Response backed by a
ReadableStream, without buffering either entire body.
Native Image builds use Netty for HTTP/1.1 and HTTP/2, with native sockets and TLS
when available and NIO/JSSE fallbacks. JVM mode retains the JDK server. elide info
reports the selected backend, TLS provider and available static/dynamic linkage
evidence; an unknown linkage value does not establish static linking.
With the Netty backend, request.signal is aborted on detected peer disconnects,
including before the handler writes a response. NIO reads ahead within a bounded
window; a disconnect behind a full unread request body remains subject to
backpressure. The JDK server does not expose prewrite disconnect notifications.