a tool for shared writing and social publishing

add dev url to map domain to local url

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