assignAttributes
constassignAttributes: (config?) =>Policy
Defined in: src/policies/transform/assign-attributes.ts:40
Set key-value attributes on the Hono request context.
Parameters
Section titled “Parameters”config?
Section titled “config?”Must include attributes — a record of keys to values or resolver functions.
Returns
Section titled “Returns”A Policy at priority 50 (REQUEST_TRANSFORM).
Example
Section titled “Example”import { assignAttributes } from "@homegrower-club/stoma";
assignAttributes({ attributes: { "x-tenant": "acme", "x-request-path": (c) => new URL(c.req.url).pathname, },});