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-buildsafter install to letesbuild(the CLI's bundler) fetch its binary — pnpm blocks dependency build scripts by default, andcamelon dev/buildneed 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/expressalso exportslisten(app), a dev helper that finds a free port (start from 3333, or pin withPORT). Plainapp.listenis 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.