mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-16 08:08:56 -05:00
fix share page
This commit is contained in:
parent
0b139f184d
commit
3e1acfce42
@ -1,4 +1,4 @@
|
|||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { APP_URL, APP_NAME, APP_DESCRIPTION } from "~/lib/constants";
|
import { APP_URL, APP_NAME, APP_DESCRIPTION } from "~/lib/constants";
|
||||||
import { getFrameEmbedMetadata } from "~/lib/utils";
|
import { getFrameEmbedMetadata } from "~/lib/utils";
|
||||||
@ -7,8 +7,12 @@ export const revalidate = 300;
|
|||||||
// This is an example of how to generate a dynamically generated share page based on fid:
|
// 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,
|
// 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.
|
// with the image dynamically generated by the opengraph-image API route.
|
||||||
export async function generateMetadata({ params }: { params: { fid: string } }): Promise<Metadata> {
|
export async function generateMetadata({
|
||||||
const fid = params.fid;
|
params,
|
||||||
|
}: {
|
||||||
|
params: Promise<{ fid: string }>;
|
||||||
|
}): Promise<Metadata> {
|
||||||
|
const { fid } = await params;
|
||||||
const imageUrl = `${APP_URL}/api/opengraph-image?fid=${fid}`;
|
const imageUrl = `${APP_URL}/api/opengraph-image?fid=${fid}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -27,4 +31,4 @@ export async function generateMetadata({ params }: { params: { fid: string } }):
|
|||||||
export default function SharePage() {
|
export default function SharePage() {
|
||||||
// redirect to home page
|
// redirect to home page
|
||||||
redirect("/");
|
redirect("/");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user