Explorer

definy.json-response

description
(en) Respond with JSON and the CORS headers
type
Fn(status: Number, body: @definy.json) -> @definy.service-io
expression
fn(status$0, body$1) =>
  #done<@definy.service-io>(#respond({
    status: $0,
    headers: @core.list-concat(
      left: [{name: "Content-Type", value: "application/json; charset=utf-8"}],
      right: @definy.cors-headers
    ),
    body: #json<@definy.http-body>($1)
  }))
visibility
public
definy.json-response (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: gUbhATQx3L1FzWPr8tyX6OqWPk23aZ4AseX91k4DfEU
content hash: PgZesH2mJWjATFkJOGq2mQ4ULBIzFyaAqzmBWgioqt8