Effect CommunityEC
Effect Community13mo ago
2 replies
Gary

Specifying a Payload for a Node `Request` Text in Effect Typescript

When defining a API how can I specify a payload for a node Request text?
  const body = await request.text()

export const apiSchema = HttpApiGroup.make('stripe').add(
  HttpApiEndpoint.post('payment', '/api/payments/stripe')
    .setHeaders(
      S.Struct({
        'stripe-signature': S.String,
      }),
    )
    .setPayload(S.String) // What do I put here to get the text?
    .addSuccess(S.Void, { status: 200 }),
)
Was this page helpful?