Skip to content

Refactor existing modes into generator registry #50

Description

@t1

Extract curl and HTTPie generation from the form submit handler in app.js into standalone generator functions. Introduce a generator registry (Map<String, Function>) where each key is the display label and each value is a generator function with signature generate({ method, url, headers, body, contentType, schema }) → string.

The form submit handler should call generators[label](params) for all copy-format modes and copy the result to clipboard. The Try mode remains special (sends the actual request).

No new formats, no UX changes. The 3-segment toggle stays as-is.

Part of #11. See spec: docs/superpowers/specs/2026-04-12-issue-11-output-formats-design.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    approvedReviewed by maintainer — agents may read and act

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions