From 609eeade23de3c1ec642abd1e213889b746e3265 Mon Sep 17 00:00:00 2001 From: Cameron Pak Date: Mon, 6 Apr 2026 06:58:43 -0500 Subject: [PATCH] Fix: Correct standalone mode logic and API call Adjusted the condition for standalone mode to correctly check for `adminOptions` when `serveStatic` is not enabled, ensuring the warning message is displayed appropriately. Updated the `getApi` call to pass optional headers when available, allowing for authenticated API requests with custom headers. --- app/src/adapter/web/web.adapter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/adapter/web/web.adapter.ts b/app/src/adapter/web/web.adapter.ts index 5dc18971..8e1327c0 100644 --- a/app/src/adapter/web/web.adapter.ts +++ b/app/src/adapter/web/web.adapter.ts @@ -25,7 +25,7 @@ export function createBknd(config: AdapterModeWithOptions, env?: Env) async function getApp(): Promise { if (!appPromise) { if (mode === "standalone") { - if (!options.serveStatic && !options.adminOptions) { + if (options.adminOptions && !options.serveStatic) { $console.warn( "adminOptions provided without serveStatic — admin UI assets may not be served. " + "See `serveStatic`, `serveStaticViaImport`, or add a `package.json` script that runs `bknd copy-assets --out {relative_static_assets_directory_path}`.", @@ -46,7 +46,7 @@ export function createBknd(config: AdapterModeWithOptions, env?: Env) await api.verifyAuth(); return api; } - return app.getApi(); + return app.getApi(opts?.headers ? { headers: opts.headers } : undefined); } function serve() {