Add per-request CSP nonces (drop script unsafe-inline), post-deploy /api/health gate, bump next-auth to beta.32, and remove unused motion/cache/permission helpers. Co-authored-by: Cursor <[email protected]>
12 lines
406 B
TypeScript
12 lines
406 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
/** Standard success response: { ok: true, ...data } */
|
|
export function apiOk(data?: Record<string, unknown>) {
|
|
return NextResponse.json({ ok: true, ...data });
|
|
}
|
|
|
|
/** Standard error response: { error: message } with given status */
|
|
export function apiError(message: string, status: number = 400) {
|
|
return NextResponse.json({ error: message }, { status });
|
|
}
|