@mmmnt/feat-adapter-http
v0.1.8
Published
Feat response adapter: HTTP invocation (method/path routes from response.commands, baseUrl/headers from invoke, actor headers from the actor registry).
Readme
@mmmnt/feat-adapter-http
Response adapter for Feat: delivers a spec's when: stimulus as an HTTP request to a running
service. Commands map to { method, path } routes with {param} substitution from the
payload (substituted params leave the body; GET/HEAD send the rest as query params). Actors
resolve to header sets; anonymous sends no auth headers.
// feat.config.json
"response": {
"adapter": "@mmmnt/feat-adapter-http",
"commands": {
"CreateUser": { "method": "POST", "path": "/users" },
"GetUser": { "method": "GET", "path": "/users/{userId}" }
},
"invoke": { "baseUrl": "http://localhost:3000" },
"actors": { "admin": { "headers": { "authorization": "Bearer …" } } }
}The HTTP response is normalized to the { status, body } shape predictions match against.
Use this to point Feat at any service that speaks HTTP, regardless of implementation language.
Part of Feature — the .feat execution specification
language. Adapter contract: https://github.com/mmmnt/feature/wiki/Architecture
MIT
