initial commit
This commit is contained in:
8
app/api/preview/route.ts
Normal file
8
app/api/preview/route.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { readJson, route } from "@/lib/http";
|
||||
import { renderMarkdown } from "@/lib/markdown";
|
||||
|
||||
/** Body: { markdown } -> { html }, rendered by the site's own pipeline. */
|
||||
export const POST = route(async (req) => {
|
||||
const { markdown } = await readJson<{ markdown?: string }>(req);
|
||||
return Response.json({ html: await renderMarkdown(markdown ?? "") });
|
||||
});
|
||||
Reference in New Issue
Block a user