From 0fffa26d558bc2373724a265d984ad550f80147b Mon Sep 17 00:00:00 2001 From: cameronapak Date: Wed, 16 Jul 2025 22:47:09 -0500 Subject: [PATCH] docs: add local media adapter example for Node.js --- docs/modules/media.mdx | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/modules/media.mdx b/docs/modules/media.mdx index 0e413da..f14f7b1 100644 --- a/docs/modules/media.mdx +++ b/docs/modules/media.mdx @@ -50,4 +50,31 @@ export default { } } } satisfies BkndConfig; -``` \ No newline at end of file +``` + +### Local adapter for development + +For local development and testing, you can use the local file system adapter. This is particularly useful when working with Node.js environments. + +```typescript bknd.config.ts +import { registerLocalMediaAdapter } from "bknd/adapter/node"; +import type { BkndConfig } from "bknd/adapter"; + +// Register the local media adapter +const local = registerLocalMediaAdapter(); + +export default { + initialConfig: { + media: { + enabled: true, + adapter: local({ + path: "./public/uploads", // Files will be stored in this directory + }), + } + } +} satisfies BkndConfig; +``` + +This configuration will store uploaded files in the specified directory, +making them accessible through your application's public path or whever +you choose.