server/utils/response.ts

8 lines
179 B
TypeScript
Raw Normal View History

2023-09-11 05:46:20 +02:00
export const jsonResponse = (data: object, status = 200) => {
2023-09-11 05:31:08 +02:00
return new Response(JSON.stringify(data), {
headers: {
"Content-Type": "application/json"
},
status,
});
}