docs(production): standardiserad produktionsberedskap och gap-analys
Lägger docs/production-readiness.md och siax/production-gaps.json enligt SIAX Master Definition of Done. Underlag: git-, kod- och live-evidens 2026-11-11. Nivån är evidensbaserad, inte ett leveransgodkännande.
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
// GET /api/uploads — list uploaded files. Returns 501 until storage is configured.
|
||||
export async function GET() {
|
||||
const haveR2 = process.env.R2_ACCESS_KEY_ID && process.env.R2_BUCKET && process.env.R2_ENDPOINT;
|
||||
if (!haveR2) {
|
||||
return NextResponse.json([], { status: 501 });
|
||||
}
|
||||
return NextResponse.json([]);
|
||||
}
|
||||
|
||||
// POST /api/uploads (docs/04) — issue a presigned R2 PUT URL. Env-guarded:
|
||||
// returns 501 until R2 storage is configured, and until presign generation
|
||||
// is implemented — a configured-but-unimplemented state must not report
|
||||
// success. Client then PUTs the file directly.
|
||||
export async function POST() {
|
||||
const haveR2 = process.env.R2_ACCESS_KEY_ID && process.env.R2_BUCKET && process.env.R2_ENDPOINT;
|
||||
if (!haveR2) {
|
||||
return NextResponse.json(
|
||||
{ error: { code: "storage_not_configured", message: "Filuppladdning aktiveras när R2/Blob är kopplat" } },
|
||||
{ status: 501 },
|
||||
);
|
||||
}
|
||||
// TODO: presigned PUT generation not implemented yet — keep returning 501
|
||||
// instead of a fake 200/null success shape until real R2 presign wiring exists.
|
||||
return NextResponse.json(
|
||||
{ error: { code: "storage_not_configured", message: "Presignerad uppladdning är inte implementerad än" } },
|
||||
{ status: 501 },
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user