flatten app to repo root and update docker deployment for single-stack runtime
This commit is contained in:
11
lib/server/http.ts
Normal file
11
lib/server/http.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export function jsonError(message: string, status = 400) {
|
||||
return Response.json({ error: message }, { status });
|
||||
}
|
||||
|
||||
export function asErrorMessage(error: unknown, fallback: string) {
|
||||
if (error instanceof Error && error.message.trim().length > 0) {
|
||||
return error.message;
|
||||
}
|
||||
|
||||
return fallback;
|
||||
}
|
||||
Reference in New Issue
Block a user