mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-04 00:56:01 +00:00
finalize waku example
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { createFrameworkApp } from "bknd/adapter";
|
||||
import config from "../bknd.config";
|
||||
|
||||
export async function getApp() {
|
||||
return await createFrameworkApp(config, process.env, {
|
||||
force: import.meta.env && !import.meta.env.PROD,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getApi(opts?: {
|
||||
headers?: Headers | any;
|
||||
verify?: boolean;
|
||||
}) {
|
||||
const app = await getApp();
|
||||
if (opts?.verify && opts.headers) {
|
||||
const api = app.getApi({ headers: opts.headers });
|
||||
await api.verifyAuth();
|
||||
return api;
|
||||
}
|
||||
|
||||
return app.getApi();
|
||||
}
|
||||
Reference in New Issue
Block a user