elastic / stream

Test utility for streaming data via udp/tcp/tls/webhook/GCP Pub-Sub/Kafka.
https://container-library.elastic.co/r/observability/stream
Apache License 2.0
8 stars 13 forks source link

pkg/httpjson: add minify_json template helper #74

Closed efd6 closed 8 months ago

efd6 commented 8 months ago

This helper allows nicely formatted JSON to be sent the the client as single-line JSON text.

rules:
- path: "/static/minify"
  methods: ["GET"]

  responses:
  - status_code: 200
    body: |-
      {{ minify_json `
      {
        "key1": "value1",
        "key2": "value2"
      }
      `}}

will respond to requests to /static/minify with {"key1":"value1","key2":"value2"}.

elasticmachine commented 8 months ago

:green_heart: Build Succeeded

History