Deno
The Deno compile path is a managed runtime β you write a handler and register it with start(handler), and the platform compiles your TypeScript/JavaScript to a self-contained native binary and runs it. The artifact is compact, so cold starts are fast. The platform owns the HTTP server, the listening port, and the readiness probe; you only write the handler.
Handler contract
A handler has this type, wired up by start(handler) from the ignite import:
type Handler = (payload: Uint8Array, ctx: Context) =>
Promise<HandlerResult> | HandlerResult;
type HandlerResult = Uint8Array | string;A minimal idiomatic main.ts (illustrative β there is no in-repo sample):
import { start } from "ignite";
const handler = (payload: Uint8Array, ctx: Context): string => {
const text = new TextDecoder().decode(payload);
const event = text ? JSON.parse(text) : {};
const name = event.name ?? "world";
return JSON.stringify({
greeting: `Hello, ${name}!`,
execution_id: ctx.execution_id,
function_id: ctx.function_id,
});
};
start(handler);Context
ctx implements the Context interface:
| Member | Type | Description |
|---|---|---|
execution_id | string | this invocationβs ID |
function_id | string | the app ID |
organization_id | string | the owning organizationβs ID |
headers | Headers | inbound request headers |
Input & output
payload is a Uint8Array of the request body β decode it yourself (for example with new TextDecoder()). The return value is encoded by type:
| Return type | Encoding |
|---|---|
string | encoded as UTF-8 |
Uint8Array | sent verbatim |
Both return HTTP 200. A thrown error yields HTTP 500 with a JSON body of the form `{error}`.
Dependencies
Use Deno-style imports (URL or bare specifiers), optionally backed by a deno.json. The ignite import is mapped to the bundled SDK by the compiler via deno.json.
Project layout
Ship an archive (zip / tar.gz) with main.ts (or main.js) at the root. The entrypoint is the file that calls start(handler).
Logging
Use console.error; its output goes to stderr.
What it compiles to
A self-contained native binary built with deno compile -A. Toolchain: Deno 2.7.14.
Deploy
dodil ignite app create hello --runtime deno
dodil ignite draft save org:hello --code ./main.ts
dodil ignite draft publish org:hello
dodil ignite invoke org:hello -p '{"name": "world"}'See also
- Code & Runtimes β the compile vs image paths
- Python compile contract
- Rust compile contract
- Go compile contract
- Container images β bring or build your own container
- Quickstart