a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use route instead of page for local url mapper

+7 -5
+7 -5
app/lish/url/[url]/page.tsx app/lish/url/[url]/route.tsx
··· 1 1 import { AtUri } from "@atproto/syntax"; 2 - import Link from "next/link"; 3 2 import { redirect } from "next/navigation"; 3 + import { NextRequest } from "next/server"; 4 4 import { supabaseServerClient } from "supabase/serverClient"; 5 5 6 - export default async function AllPubs(props: { 7 - params: Promise<{ url: string }>; 8 - }) { 6 + export async function GET( 7 + _req: NextRequest, 8 + props: { params: Promise<{ url: string }> }, 9 + ) { 9 10 if (process.env.NODE_ENV === "production") 10 11 return new Response("Not allowed", { status: 403 }); 11 12 let { url } = await props.params; ··· 15 16 .eq("domain", url) 16 17 .single(); 17 18 18 - if (!publication) return <div>Publication not found</div>; 19 + if (!publication) 20 + return new Response("Publication not found", { status: 404 }); 19 21 let uri = new AtUri(publication.publication); 20 22 return redirect(`/lish/${uri.host}/${uri.rkey}`); 21 23 }