From 4730ab61170b46aafad5870e3bb51aaf66b68ddb Mon Sep 17 00:00:00 2001 From: Antigravity Date: Sat, 9 May 2026 20:08:57 +0000 Subject: [PATCH] fix: serve manifest via API route to bypass nginx 403 on static files --- memento-note/app/api/manifest/route.ts | 35 ++++++++++++++++++++++++++ memento-note/app/layout.tsx | 2 +- memento-note/app/manifest.ts | 27 -------------------- 3 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 memento-note/app/api/manifest/route.ts delete mode 100644 memento-note/app/manifest.ts diff --git a/memento-note/app/api/manifest/route.ts b/memento-note/app/api/manifest/route.ts new file mode 100644 index 0000000..bb69bc3 --- /dev/null +++ b/memento-note/app/api/manifest/route.ts @@ -0,0 +1,35 @@ +import { NextResponse } from "next/server"; + +export async function GET() { + return NextResponse.json( + { + name: "Memento Notes", + short_name: "Memento", + description: "A smart, local-first note taking app with AI capabilities.", + start_url: "/", + display: "standalone", + background_color: "#F2F0E9", + theme_color: "#1C1C1C", + icons: [ + { + src: "/icons/icon-192.svg", + sizes: "192x192", + type: "image/svg+xml", + purpose: "any maskable", + }, + { + src: "/icons/icon-512.svg", + sizes: "512x512", + type: "image/svg+xml", + purpose: "any maskable", + }, + ], + }, + { + headers: { + "Content-Type": "application/manifest+json", + "Cache-Control": "public, max-age=86400", + }, + } + ); +} diff --git a/memento-note/app/layout.tsx b/memento-note/app/layout.tsx index 47300fb..0e6ea19 100644 --- a/memento-note/app/layout.tsx +++ b/memento-note/app/layout.tsx @@ -39,7 +39,7 @@ const jetbrainsMono = JetBrains_Mono({ export const metadata: Metadata = { title: "Memento - Your Digital Notepad", description: "A beautiful note-taking app built with Next.js 16", - manifest: "/manifest.webmanifest", + manifest: "/api/manifest", icons: { icon: "/icons/icon-512.svg", apple: "/icons/icon-512.svg", diff --git a/memento-note/app/manifest.ts b/memento-note/app/manifest.ts deleted file mode 100644 index c66160b..0000000 --- a/memento-note/app/manifest.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { MetadataRoute } from "next"; - -export default function manifest(): MetadataRoute.Manifest { - return { - name: "Memento Notes", - short_name: "Memento", - description: "A smart, local-first note taking app with AI capabilities.", - start_url: "/", - display: "standalone", - background_color: "#F2F0E9", - theme_color: "#1C1C1C", - icons: [ - { - src: "/icons/icon-192.svg", - sizes: "192x192", - type: "image/svg+xml", - purpose: "any maskable", - }, - { - src: "/icons/icon-512.svg", - sizes: "512x512", - type: "image/svg+xml", - purpose: "any maskable", - }, - ], - }; -}