Local Development
Run a local V8 isolate dev server with hot reload.
Local Development
ccp dev starts a local HTTP server running your function in a real V8 isolate — the same runtime used in production.
Start the Dev Server
ccp dev
# ◼ Dev Server started!
# › http://127.0.0.1:1234The server watches your entry file for changes and hot-reloads automatically — no restart needed.
Options
| Flag | Default | Description |
|---|---|---|
--port <port> | 1234 | Port to listen on |
--hostname <host> | 127.0.0.1 | Hostname to bind to |
--env <path> | .env | Path to a custom env file |
--public-dir <path> | — | Serve static assets from this directory |
--client <path> | — | Include a client-side script |
--allow-code-generation | false | Allow eval() and new Function() |
--prod / --production | false | Set process.env.NODE_ENV to "production" |
Environment Variables
CCP automatically loads a .env file from the project root if one exists:
# .env
API_KEY=sk-abc123
DEBUG=trueccp dev
# Automatically loaded .env file...
# ◼ Dev Server started!Point to a different env file with --env:
ccp dev --env .env.stagingVariables are available in your handler via process.env:
export function handler(request: Request): Response {
const key = process.env.API_KEY;
return new Response(`Key: ${key}`);
}Static Assets
For static sites, pass the public directory:
ccp dev --public-dir publicStatic files are served directly. Non-matching paths fall through to your handler. See Static Sites for more details.
Logs
console.log(), console.error(), and console.warn() output directly to your terminal with level prefixes:
INFO Hello from the handler
ERROR Something went wrong
WARN Deprecated API usageTimeouts
The local dev server applies the same timeouts as production:
- Tick timeout: 500ms per I/O tick
- Total timeout: 30 seconds per request