Skip to content

Commit

Permalink
feat: Add okStreamResponse function to handle stream responses in t…
Browse files Browse the repository at this point in the history
…he API
  • Loading branch information
glaucia86 committed Mar 27, 2024
1 parent 3d4eb03 commit baed189
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/api/src/utils/http-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,12 @@ export function ok(body: Record<string, unknown>): HttpResponseInit {
jsonBody: body,
};
}

export function okStreamResponse(): HttpResponseInit {
return {
status: 200,
headers: {
'Content-Type': 'text/plain',
},
};
}

0 comments on commit baed189

Please sign in to comment.