27 lines
983 B
TypeScript
27 lines
983 B
TypeScript
/**
|
|
* GET /api/manifest - Modul-Contract des Kalendertools (module-plan.md Abschnitt 1).
|
|
*
|
|
* Urspruenglich unter /.well-known/app-manifest geplant, aber Next.js App Router
|
|
* routed keine Ordner mit fuehrendem Punkt (.well-known). Die Route liegt deshalb
|
|
* unter /api/manifest und wird per next.config.rewrites nach /.well-known/app-manifest
|
|
* gemappt (mit basePath: false, damit sie auch im Proxy-Modus ohne Praefix erreichbar ist).
|
|
*/
|
|
import { NextResponse } from "next/server";
|
|
|
|
export async function GET() {
|
|
const basePath = (process.env.HUB_BASE_PATH ?? "").replace(/\/$/, "");
|
|
const mpmMode = process.env.MPM_AUTH_MODE === "true";
|
|
|
|
return NextResponse.json(
|
|
{
|
|
name: "Kalendertool",
|
|
slug: "kalendartool",
|
|
version: "1.1.0",
|
|
icon: "/icon.png",
|
|
auth: mpmMode ? { mode: "mpm-gateway" } : { mode: "hub-token", path: "/auth/hub" },
|
|
basePath: basePath || "/",
|
|
},
|
|
{ headers: { "Cache-Control": "public, max-age=60" } }
|
|
);
|
|
}
|