Your Files Are APIs. One Comment Changes Everything.
Write a TypeScript function and it is instantly a live HTTP endpoint, powered by Bun. Add one comment to control the execution mode, CORS, timeout, auth, or AI. No frameworks. No servers. No config.
// @mode serverless
// @cors reflective
// @timeout 5000
return { message: 'Hello from Hoody Exec!', time: Date.now() };
# Live at:
https://abc123-def456-exec-1.node-us-1.containers.hoody.com/hello
Two Modes. One Comment.
Every script declares an execution mode, and that one decision changes everything about how it runs. Worker for stateful real-time servers. Serverless for isolated, fresh-per-request execution.
Worker Mode
- Persistent V8 isolate — created once, stays warm forever
- Shared state persists across every request
- WebSocket support for real-time connections
- Zero cold start after the first request
Serverless Mode
- Brand new V8 isolate for every single request
- Complete isolation — zero state leakage
- Concurrency control via @concurrent
- Safer for untrusted code, webhooks, and sporadic traffic
Every Behavior. One Line.
Drop a comment at the very top of your file. No code changes, no config files, no middleware. Change the comment and the behavior changes instantly at load time.
Execution Mode
Choose a persistent Worker VM or a fresh Serverless isolate per request. Determines state, WebSocket support, and cold start. Defaults to serverless.
CORS Control
Mirror the request origin with reflective, open everything with *, lock to a specific URL, or disable with none. Default is none — zero middleware required.
Request Timeout
Set the request timeout in milliseconds. Defaults to one hour (3600000ms). Use 0 or unlimited to remove the limit entirely.
Concurrency Cap
Serverless-only. Cap simultaneous executions with a number, allow unlimited with true (the default), or set false for serial processing — essential for webhook ordering.
Endpoint Auth
Protect any endpoint with a shared secret. Clients authenticate via Bearer, Basic password, X-Token header, or query param. Constant-time SHA-256 comparison, redacted in every log.
WebSocket Support
Enable real-time bidirectional connections. Requires worker mode. The ws.open, ws.message, and ws.close handlers are injected automatically.
AI Helpers
Injects model, openai, ai, generateText, streamText, and generateObject from the Vercel AI SDK. No imports, no API key setup, model pre-configured.
AI Model Selection
Override the model per script. Defaults to google/gemini-2.5-flash-lite, with access to 300+ models from 15+ inference providers through Hoody AI.
Log Verbosity
Tune logging from none and minimal up through standard (the default), full, and debug. No external logging stack to wire up.
Magic Comment Reference.
Every comment, every value, every default — parsed at script load time, taking precedence over the defaults.
Sets the execution mode. worker creates a persistent VM with shared state; serverless (the default) creates a fresh VM per request. Always declare it first.
SYNTAX
From Webhook to WebSocket in Minutes.
Patterns that span the full range — from instant HTTP APIs to real-time AI interception — each just a file with the right magic comments.
Instant APIs
Skip Express and Fastify setup entirely. Write a function in a file and it is a live HTTP endpoint. Worker mode for high traffic, serverless for isolation.
Webhook Receivers
Stripe, GitHub, and Slack webhooks with serverless isolation that prevents cross-contamination. Use @concurrent false for strict serial ordering.
WebSocket Servers
Chat servers, live dashboards, and SSE streams. Worker mode keeps persistent connections alive with shared room state and broadcast helpers.
AI Interception
Intercept and control AI requests with a worker-mode MITM proxy. Add safety checks, modify prompts, block sensitive data, and track usage in one script.
Rate Limiting
Track per-IP request counts in the shared object across requests. Worker mode makes in-memory rate limiting and session management trivial.
Script Composition
Every script is an HTTP endpoint, so scripts call each other with fetch(). Compose microservices from simple functions — no queues, no service discovery.
Every API Surface, One Place.
Script execution, management, validation, templates, routing, dependencies, logs, monitoring, schedules, and magic comment control — every endpoint relative to your Exec instance.
https://abc123-def456-exec-1.node-us-1.containers.hoody.comScript Execution
1 endpointScript Management
6 endpointsValidation
6 endpointsTemplates
6 endpointsMagic Comments
4 endpointsDependencies & Packages
9 endpointsRouting
3 endpointsCache & Shared State
4 endpointsLogs
5 endpointsMonitoring & Health
6 endpointsSchedules
4 endpointsSDK Management
4 endpointsUser OpenAPI
6 endpointsInstances & System
3 endpointsWrite a Function. Get an API.
Your code is the API. Drop a file into your Exec instance and it is instantly a live HTTP endpoint — routing, JSON serialization, dependency installation, and production-grade execution included.