mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-15 23:58:56 -05:00
This reverts commit b1fdfc19a92241638692d58494f48ce1bb25df74, reversing changes made to b9e2087bd8cd9e8ed7a5862936609b5bf29aa911.
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { redirect } from "next/navigation";
|
|
import { APP_URL, APP_NAME, APP_DESCRIPTION } from "~/lib/constants";
|
|
import { getMiniAppEmbedMetadata } from "~/lib/utils";
|
|
export const revalidate = 300;
|
|
|
|
// This is an example of how to generate a dynamically generated share page based on fid:
|
|
// Sharing this route e.g. exmaple.com/share/123 will generate a share page for fid 123,
|
|
// with the image dynamically generated by the opengraph-image API route.
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: Promise<{ fid: string }>;
|
|
}): Promise<Metadata> {
|
|
const { fid } = await params;
|
|
const imageUrl = `${APP_URL}/api/opengraph-image?fid=${fid}`;
|
|
|
|
return {
|
|
title: `${APP_NAME} - Share`,
|
|
openGraph: {
|
|
title: APP_NAME,
|
|
description: APP_DESCRIPTION,
|
|
images: [imageUrl],
|
|
},
|
|
other: {
|
|
"fc:frame": JSON.stringify(getMiniAppEmbedMetadata(imageUrl)),
|
|
},
|
|
};
|
|
}
|
|
|
|
export default function SharePage() {
|
|
// redirect to home page
|
|
redirect("/");
|
|
}
|