diff options
| author | Mohamed Bassem <me@mbassem.com> | 2024-10-20 14:23:15 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2024-10-20 14:23:15 +0000 |
| commit | 62395ecbbfef38686073369443d99249421b2e22 (patch) | |
| tree | c6e721e6e9b1807b23e98bb1db51b3e13d8e3e30 /apps/web/app/api/v1/bookmarks | |
| parent | fb297eaadee9b741ddb6731a91eb4648020dcb3b (diff) | |
| download | karakeep-62395ecbbfef38686073369443d99249421b2e22.tar.zst | |
feature: Add GET REST APIs for bookmarks, lists and tags
Diffstat (limited to 'apps/web/app/api/v1/bookmarks')
| -rw-r--r-- | apps/web/app/api/v1/bookmarks/[bookmarkId]/route.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/web/app/api/v1/bookmarks/[bookmarkId]/route.ts b/apps/web/app/api/v1/bookmarks/[bookmarkId]/route.ts new file mode 100644 index 00000000..af4c0792 --- /dev/null +++ b/apps/web/app/api/v1/bookmarks/[bookmarkId]/route.ts @@ -0,0 +1,18 @@ +import { NextRequest } from "next/server"; +import { buildHandler } from "@/app/api/v1/utils/handler"; + +export const dynamic = "force-dynamic"; + +export const GET = ( + req: NextRequest, + { params }: { params: { bookmarkId: string } }, +) => + buildHandler({ + req, + handler: async ({ api }) => { + const bookmark = await api.bookmarks.getBookmark({ + bookmarkId: params.bookmarkId, + }); + return { status: 200, resp: bookmark }; + }, + }); |
