added adapter exports, generalized env-depending config construction

This commit is contained in:
dswbx
2025-01-25 11:54:19 +01:00
parent acc504cdc9
commit 9ddacb7ae5
11 changed files with 53 additions and 35 deletions

View File

@@ -1,3 +1,4 @@
import type { APIContext } from "astro";
import { App } from "bknd";
import { serve } from "bknd/adapter/astro";
import { registerLocalMediaAdapter } from "bknd/adapter/node";
@@ -23,7 +24,7 @@ declare module "bknd/core" {
interface DB extends Database {}
}
export const ALL = serve({
export const ALL = serve<APIContext>({
// we can use any libsql config, and if omitted, uses in-memory
connection: {
type: "libsql",

View File

@@ -3,7 +3,7 @@ import { serve } from "bknd/adapter/cloudflare";
import manifest from "__STATIC_CONTENT_MANIFEST";
export default serve({
app: (env: Env) => ({
app: (args) => ({
connection: {
type: "libsql",
config: {