Skip to content
Hoody.com

Execute scripts as HTTP endpoints. Every script on the container maps to a hostname and path, and any HTTP method reaches that script at the same URL with the same behaviour (a small set of exceptions is described below). Use this endpoint to call any deployed script by its route, or to read a .md documentation file beside it.

Dispatch a request to the script at path. POST is accepted at the same endpoint with identical behaviour. The script can set its own status with res.status() and its own Content-Type with res.setHeader(); without those, the service picks a Content-Type from the returned value: objects and arrays become JSON, strings starting with HTML markup become HTML, other strings and Buffers become plain text or bytes-by-type, and streams are written as they produce.

A few exceptions apply on every method: OPTIONS is answered 204 by the CORS preflight before any script runs (unless a proxy hook dispatches it); HEAD runs the script but sends no body; PUT, PATCH, DELETE and any other method with a body read the body as POST does, parsed by Content-Type (JSON, form, multipart or raw bytes) unless the script declares @rawBody. A path ending in .md returns that documentation file instead of running a script; beside a script, the file is served under that script’s @enabled and @token. /favicon.ico is answered by the service on an exclusive origin (an .exclusive marker in the deployment directory), else 404. When a proxy hook on this URL dispatches the request, the upstream is reached via metadata.hook.forward(); the hook’s onUpstreamError fallback answers instead when the upstream fails.

NameInTypeRequiredDescription
pathpathstringYesScript path (supports Next.js-style routing). Each segment is percent-encoded once; a leading / is optional.

This endpoint accepts no request body.

The script ran and produced a body. The Content-Type is chosen by the script when it sets one; otherwise the service picks one from the returned value (JSON, HTML, plain text, markdown, or a binary type are all possible). A path ending in .md instead returns the contents of that documentation file, served under the script’s @enabled and @token when a script sits beside it. A returned Response is forwarded with its own status and headers, less the framing and hop-by-hop ones.

{
"status": "ok",
"message": "Webhook processed"
}

Default GET request to a script:

Terminal window
curl "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/scripts/handle-webhook"

POST with a JSON body:

Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/scripts/handle-webhook" \
-H "Content-Type: application/json" \
-d '{"event": "push"}'