Skip to content
home / kit / exec
ExecHOODY EXEC

Your Files Are APIs. One Comment Changes Everything.

Write a TypeScript function — it's instantly a live HTTP endpoint. Add one comment to control auth, CORS, mode, or AI. No config. No middleware.

exec / hello.ts

// @mode serverless

// @cors reflective

// @token my-secret-key

return { message: 'Hello!', time: Date.now() };

# Live at:

https://proj-cont-exec-1.us1.containers.hoody.com/hello

Instant HTTP endpoint — no config needed
home / kit / exec / modes
EXECUTION MODES

Two Modes. One Comment.

Every script picks a mode. Worker for stateful real-time apps. Serverless for isolated, ephemeral execution. One comment is all it takes.

Worker Mode

// @mode worker
  • Persistent V8 isolate — stays warm forever
  • Shared state across all requests
  • WebSocket supported
  • Zero cold start after first request

Serverless Mode

// @mode serverless // @concurrent 10
  • Fresh V8 isolate per request
  • Complete isolation, no state leakage
  • Configurable concurrency via @concurrent
  • Ideal for webhooks and sporadic traffic
home / kit / exec / magic-carousel
MAGIC COMMENTS

Every Behavior. One Line.

Drop a comment at the top of your file. No code changes, no config files, no middleware. Change the comment — behavior changes instantly.

EXECUTION
// @mode worker

Execution Mode

Choose between a persistent Worker VM or a fresh Serverless isolate per request. Determines state, WebSocket, and cold start behavior.

NETWORK
// @cors reflective

CORS Control

Mirror the request origin with 'reflective', open all origins with '*', or lock to a specific URL. Zero middleware required.

LIMITS
// @timeout 30000

Request Timeout

Set the timeout in milliseconds. Default is 30s. Use 0 or 'unlimited' for long-running scripts. Prevents runaway executions.

LIMITS
// @concurrent 10

Concurrency Cap

Serverless-only: cap simultaneous executions. Set to 'false' for serial processing — essential for webhook ordering.

AUTH
// @token my-secret

Endpoint Auth

Protect any endpoint with a shared secret. Clients authenticate via Bearer, Basic, X-Token header, or query param. Constant-time comparison.

REALTIME
// @websocket true

WebSocket Support

Enable real-time bidirectional connections. Requires Worker mode. ws.message, ws.open, ws.close handlers injected automatically.

AI
// @ai true

AI Helpers

Injects generateText, streamText, generateObject from the Vercel AI SDK. No imports, no API key setup. Model pre-configured.

AI
// @ai-model anthropic/claude-sonnet-4.5

AI Model Selection

Override the default AI model per script. Default: google/gemini-2.5-flash-lite. Supports 300+ models from 14 providers.

CLOUD
// @aws true

AWS Integration

Enable the AWS SDK inside your script with a single comment. Access S3, DynamoDB, Lambda, and any other AWS service directly.

home / kit / exec / accordion
REFERENCE

Complete Magic Comment Reference.

Every comment, every value, every default. All in one place.

@modeEXECUTION

Sets the execution mode for the script. 'worker' creates a persistent VM; 'serverless' (default) creates a fresh VM per request.

SYNTAX

// @mode worker // @mode serverless
home / kit / exec / use-cases
USE CASES

From Webhook to WebSocket in Minutes.

Six patterns that cover the full range — from instant HTTP APIs to real-time AI proxies.

Instant APIs

Skip Express setup entirely. Create a file — it's a live HTTP endpoint. Worker for high traffic, serverless for isolation.

Webhook Receivers

Stripe, GitHub, Slack webhooks with serverless isolation. Use @concurrent false for serial processing and consistent ordering.

WebSocket Servers

Chat servers, live dashboards, SSE streams. Worker mode maintains persistent connections with shared room state.

AI MITM Proxy

Intercept and control AI requests. Add safety checks, modify prompts, block sensitive data, track usage — all in one script.

Rate Limiting

Track per-IP request counts in the shared object across requests. Worker mode makes in-memory rate limiting trivial.

Script Composition

Every script is an HTTP endpoint. Call other scripts with fetch(). Compose microservices from simple functions — no queues, no discovery.

home / kit / exec / endpoints
50+ ENDPOINTS

Every API Surface, One Place.

Script execution, management, validation, templates, routing, monitoring, and magic comment control — all in one API.

Monitoring & Magic API

8 endpoints

GET /api/v1/exec/monitor/stats

GET
/api/v1/exec/monitor/statsPerformance metrics
GET
/api/v1/exec/monitor/active-requestsActive requests
POST
/api/v1/exec/monitor/script-performancePer-script metrics
GET
/api/v1/exec/monitor/healthHealth check
GET
/api/v1/exec/magic-comments/schemaGet magic comments schema
GET
/api/v1/exec/magic-comments/readRead script magic comments
PUT
/api/v1/exec/magic-comments/updateUpdate magic comments
POST
/api/v1/exec/magic-comments/bulk-updateBulk update magic comments

Execution & Scripts

7 endpoints

GET/POST /:path

GET
/:pathExecute script via file-based route
POST
/:pathExecute script with request body
GET
/api/v1/exec/scripts/listList all scripts
GET
/api/v1/exec/scripts/readRead script content
POST
/api/v1/exec/scripts/writeCreate or update a script
DELETE
/api/v1/exec/scripts/deleteDelete a script
POST
/api/v1/exec/scripts/treeGet directory tree

Validation

6 endpoints

POST /api/v1/exec/validate/script

POST
/api/v1/exec/validate/scriptComprehensive script validation
POST
/api/v1/exec/validate/typescriptTypeScript type checking
POST
/api/v1/exec/validate/syntaxSyntax validation
POST
/api/v1/exec/validate/magic-commentsParse and validate magic comments
POST
/api/v1/exec/validate/dependenciesDependency analysis
POST
/api/v1/exec/validate/return-typeReturn type validation

Templates & Routing

6 endpoints

GET /api/v1/exec/templates/list

GET
/api/v1/exec/templates/listList available templates
GET
/api/v1/exec/templates/previewPreview a template
POST
/api/v1/exec/templates/generateCreate script from template
POST
/api/v1/exec/route/resolveResolve URL to script path
POST
/api/v1/exec/route/discoverDiscover all routes
POST
/api/v1/exec/route/testTest route matching
home / kit / exec / cta

Your Code Is the API.

Write a TypeScript function. Add one comment. It's live.

Read the Docs