Files
2025-04-15 03:59:33 +08:00

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' },
});
}