mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
update app create config to accept libsql config directly
This commit is contained in:
@@ -43,12 +43,9 @@ export const prerender = false;
|
||||
|
||||
export const ALL = serve({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
// location of your local Astro DB
|
||||
// make sure to use a remote URL in production
|
||||
url: "file:.astro/content.db"
|
||||
}
|
||||
// location of your local Astro DB
|
||||
// make sure to use a remote URL in production
|
||||
url: "file:.astro/content.db"
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
@@ -19,11 +19,8 @@ import { serve } from "bknd/adapter/bun";
|
||||
// if the configuration is omitted, it uses an in-memory database
|
||||
serve({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: process.env.DB_URL!,
|
||||
authToken: process.env.DB_AUTH_TOKEN!
|
||||
}
|
||||
url: process.env.DB_URL!,
|
||||
authToken: process.env.DB_AUTH_TOKEN!
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
@@ -22,11 +22,8 @@ import { serve } from "bknd/adapter/cloudflare";
|
||||
export default serve<Env>({
|
||||
app: ({ env }) => ({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: env.DB_URL,
|
||||
authToken: env.DB_TOKEN
|
||||
}
|
||||
url: env.DB_URL,
|
||||
authToken: env.DB_TOKEN
|
||||
}
|
||||
})
|
||||
});
|
||||
@@ -83,11 +80,8 @@ import manifest from "__STATIC_CONTENT_MANIFEST";
|
||||
export default serve<Env>({
|
||||
app: ({ env }) => ({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: env.DB_URL,
|
||||
authToken: env.DB_TOKEN
|
||||
}
|
||||
url: env.DB_URL,
|
||||
authToken: env.DB_TOKEN
|
||||
}
|
||||
}),
|
||||
onBuilt: async (app) => {
|
||||
|
||||
@@ -20,11 +20,8 @@ export const config = {
|
||||
|
||||
export default serve({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: process.env.DB_URL!,
|
||||
authToken: process.env.DB_AUTH_TOKEN!
|
||||
}
|
||||
url: process.env.DB_URL!,
|
||||
authToken: process.env.DB_AUTH_TOKEN!
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
@@ -20,10 +20,7 @@ import { serve } from "bknd/adapter/node";
|
||||
/** @type {import("bknd/adapter/node").NodeAdapterOptions} */
|
||||
const config = {
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: ":memory:"
|
||||
}
|
||||
url: ":memory:"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -16,10 +16,7 @@ import { serve } from "bknd/adapter/remix";
|
||||
|
||||
const handler = serve({
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "http://localhost:8080"
|
||||
}
|
||||
url: "http://localhost:8080"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -26,10 +26,7 @@ import { serve } from "bknd/adapter/vite";
|
||||
export default serve({
|
||||
mode: "cached", // that's the default
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: ":memory:"
|
||||
}
|
||||
url: ":memory:"
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user