camelon

Install & bootstrap

camelon installs from npm. An app is a project with a src/routes/ tree, a src/document.tsx wrapper, and a small server entry that hands the handler to your runtime.

npm install camelon @kitajs/html      # + express, if you host on Node

pnpm users: run pnpm approve-builds after install to let esbuild (the CLI's bundler) fetch its binary — pnpm blocks dependency build scripts by default, and camelon dev/build need it.

Server entry

createHandler returns a web-standard (request: Request) => Promise<Response> — nothing about it is tied to Node. On a web-native runtime you hand it straight to the platform, e.g. Deno:

import { createHandler } from 'camelon';
import { manifest } from './gen/manifest.generated';

Deno.serve(await createHandler({ routes: manifest }));

On Node, mount it on Express with toExpress from the camelon/express adapter:

import express from 'express';
import { createHandler } from 'camelon';
import { toExpress } from 'camelon/express';
import { manifest } from './gen/manifest.generated';

const app = express();
app.use(toExpress(await createHandler({ routes: manifest })));
app.listen(3000);

See runtime targets for Bun, Cloudflare Workers, and the browser service worker.

camelon/express also exports listen(app), a dev helper that finds a free port (start from 3333, or pin with PORT). Plain app.listen is enough.

Commands

camelon dev        # watch: regen manifest, rebuild, restart on change
camelon build      # bundle → dist/server.mjs
node dist/server.mjs   # run the production bundle
camelon validate   # check routes: naming, collisions, contracts
camelon openapi    # write openapi.json + route-contracts.json

dev and build both use esbuild. There is no tsx or tsc at runtime.