init: solid start adapter

This commit is contained in:
2026-03-28 16:21:42 +05:30
parent 81bf41ce34
commit 8d37f9df3f
34 changed files with 1099 additions and 2 deletions
+30
View File
@@ -0,0 +1,30 @@
import { getApp as getBkndApp } from "bknd/adapter/solid-start";
import bkndConfig from "../../bknd.config";
import type { App } from "bknd";
let client: App | null = null;
export const getApp = async () => {
if (!client) {
client = await getBkndApp(bkndConfig);
}
return client;
};
export async function getApi({
headers,
verify,
}: {
verify?: boolean;
headers?: Headers;
}) {
const app = await getApp();
if (verify) {
const api = app.getApi({ headers });
await api.verifyAuth();
return api;
}
return app.getApi();
}