14 lines
384 B
JavaScript
14 lines
384 B
JavaScript
export function createErrorResponse(message, status) {
|
|
return new Response(JSON.stringify({"error": message}), {
|
|
status: status,
|
|
headers: { 'Content-Type': 'application/json' },
|
|
});
|
|
}
|
|
|
|
export function createSuccessResponse(data, status = 200) {
|
|
return new Response(JSON.stringify(data), {
|
|
status: status,
|
|
headers: { 'Content-Type': 'application/json' },
|
|
});
|
|
}
|