export function internalServerError(err: unknown, body: string = "An unknown error has occurred.") {
console.error("Internal Server Error", String(err));
return new Response(body, {
status: 500,
statusText: "Internal Server Error",
});
}
export function badRequest(body: string = null) {
return new Response(body, {
status: 400,
statusText: "Bad Request",
});
}
export function forbidden(body: string = null) {
return new Response(body, {
status: 401,
statusText: "Forbidden",
});
}
export function success(body: string = null) {
return new Response(body, {
status: 200,
statusText: "OK",
});
}