verified cloudflare workers + added configs where to navigate after login/logout

This commit is contained in:
dswbx
2024-11-26 13:26:11 +01:00
parent 9d896a6ab1
commit d36c4b07e0
7 changed files with 79 additions and 27 deletions

View File

@@ -4,19 +4,15 @@ import { Hono } from "hono";
import { serveStatic } from "hono/cloudflare-workers";
import type { BkndConfig, CfBkndModeCache } from "../index";
// @ts-ignore
import _html from "../../static/index.html";
type Context = {
request: Request;
env: any;
ctx: ExecutionContext;
manifest: any;
html: string;
html?: string;
};
export function serve(_config: BkndConfig, manifest?: string, overrideHtml?: string) {
const html = overrideHtml ?? _html;
export function serve(_config: BkndConfig, manifest?: string, html?: string) {
return {
async fetch(request: Request, env: any, ctx: ExecutionContext) {
const url = new URL(request.url);
@@ -182,7 +178,7 @@ export class DurableBkndApp extends DurableObject {
request: Request,
options: {
config: CreateAppConfig;
html: string;
html?: string;
keepAliveSeconds?: number;
setAdminHtml?: boolean;
}