This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Markdown } from "@/app/components/markdown"; | |
| import { getComments, getPost } from "@/lib/db"; | |
| import { Suspense } from "react"; | |
| export default async function PostPage({ | |
| params, | |
| }: { | |
| params: { postId: string }; | |
| }) { | |
| let post = await getPost(params.postId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ALGOLIA_APP_ID = "<your algolia app id>"; | |
| addEventListener('fetch', event => { | |
| try { | |
| const request = event.request; | |
| if (request.method.toUpperCase() === 'POST') return event.respondWith(handlePostRequest(event)); | |
| return handleRequest(request); | |
| } catch (e) { | |
| return event.respondWith(new Response('Error thrown ' + e.message)); | |
| } |