Skip to content

goss serve: render response format according to content negotiation #615

@petemounce

Description

@petemounce

Describe the feature:
goss serve can respond to the Accept http header on incoming requests, and choose the Content-Type for the response if possible based on that.

This will allow goss serve more flexibility at run-time; previously, if more than one output format was wanted, one endpoint process+port per output format would need to be set up.

Describe the solution you'd like

(This is a retroactive ticket to collect together the PRs as much as describe the work)

This is the order to merge the PRs in:

  1. Add some test coverage to the goss serve command. #606 - add some unit test coverage
  2. Add blackbox tests for serve command #608 - add some integration test coverage
  3. goss serve can now negotiate response's content-type via accept request header #609 - add the content negotiation (with documentation)

(Afterwards, #586, but since #608 adds a new script, I'll fix that up inside that PR once #608 is merged)

Describe alternatives you've considered
Setting up one endpoint per desired goss format.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions