mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
docs: corrected app function parameter signature
This commit is contained in:
@@ -52,17 +52,17 @@ export default serve();
|
|||||||
|
|
||||||
// manually specifying a D1 binding:
|
// manually specifying a D1 binding:
|
||||||
export default serve<Env>({
|
export default serve<Env>({
|
||||||
app: ({ env }) => d1({ binding: env.D1_BINDING }),
|
app: (env) => d1({ binding: env.D1_BINDING }),
|
||||||
});
|
});
|
||||||
|
|
||||||
// or specify binding using `bindings`
|
// or specify binding using `bindings`
|
||||||
export default serve<Env>({
|
export default serve<Env>({
|
||||||
bindings: ({ env }) => ({ db: env.D1_BINDING }),
|
bindings: (env) => ({ db: env.D1_BINDING }),
|
||||||
});
|
});
|
||||||
|
|
||||||
// or use LibSQL
|
// or use LibSQL
|
||||||
export default serve<Env>({
|
export default serve<Env>({
|
||||||
app: ({ env }) => ({ url: env.DB_URL }),
|
app: (env) => ({ url: env.DB_URL }),
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ import { d1 } from "bknd/adapter/cloudflare";
|
|||||||
import { withPlatformProxy } from "bknd/adapter/cloudflare/proxy";
|
import { withPlatformProxy } from "bknd/adapter/cloudflare/proxy";
|
||||||
|
|
||||||
export default withPlatformProxy({
|
export default withPlatformProxy({
|
||||||
app: ({ env }) => ({
|
app: (env) => ({
|
||||||
connection: d1({ binding: env.DB }),
|
connection: d1({ binding: env.DB }),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -217,7 +217,7 @@ Instead, it's recommended to split this configuration into separate files, e.g.
|
|||||||
import type { CloudflareBkndConfig } from "bknd/adapter/cloudflare";
|
import type { CloudflareBkndConfig } from "bknd/adapter/cloudflare";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
app: ({ env }) => ({
|
app: (env) => ({
|
||||||
connection: d1({ binding: env.DB }),
|
connection: d1({ binding: env.DB }),
|
||||||
}),
|
}),
|
||||||
} satisfies CloudflareBkndConfig;
|
} satisfies CloudflareBkndConfig;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export default {
|
|||||||
url: "file:data.db",
|
url: "file:data.db",
|
||||||
},
|
},
|
||||||
// or use the `app` function which passes the environment variables
|
// or use the `app` function which passes the environment variables
|
||||||
app: ({ env }) => ({
|
app: (env) => ({
|
||||||
connection: {
|
connection: {
|
||||||
url: env.DB_URL,
|
url: env.DB_URL,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ To manually specify which D1 database to take, you can specify it explicitly:
|
|||||||
import { serve, d1 } from "bknd/adapter/cloudflare";
|
import { serve, d1 } from "bknd/adapter/cloudflare";
|
||||||
|
|
||||||
export default serve<Env>({
|
export default serve<Env>({
|
||||||
app: ({ env }) => d1({ binding: env.D1_BINDING }),
|
app: (env) => d1({ binding: env.D1_BINDING }),
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user