http-endpoint

command
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

HTTP Endpoint

A noderun workflow that serves a real HTTP endpoint:

httpTrigger (GET /hello) → template → httpResponse

The example picks a free local port, deploys the workflow, calls GET /hello?name=world against the engine's own listener, prints the response body, then stops the workflow.

Things to notice:

  • listener: "own" binds a private TCP listener on the configured port. listener: "main" instead mounts the route on the host's shared admin server — the Node-RED model where routes live on the admin port behind admin auth.
  • For GET requests the parsed query object becomes msg.payload, so ?name=world renders through {{payload.name}}. Body-capable methods (POST/PUT/PATCH) carry the parsed request body instead. msg.method, msg.path, msg.query, msg.headers and a msg.req object are in metadata.
  • The request/response correlation is implicit: httpTrigger injects the message with a msgId, and the engine holds the HTTP handler open until a downstream httpResponse node resolves that correlation (responseTimeout bounds the wait, default 15s → 504).
  • Response status and headers can also be set per message via msg.statusCode / msg.headers — they take precedence over the httpResponse node's config.

Run from the noderun module root:

go run ./examples/http-endpoint

Expected output:

Hello world!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL