This commit is contained in:
Rizky 2023-10-16 13:33:30 +00:00
parent f2a23e8443
commit 3c4f8629a8
2 changed files with 3 additions and 3 deletions

View File

@ -31,9 +31,9 @@ if (g.db) {
} }
await parcelBuild(); await parcelBuild();
await createServer();
await generateAPIFrm(); await generateAPIFrm();
await prepareApiRoutes(); await prepareApiRoutes();
await createServer();
await prepareAPITypes(); await prepareAPITypes();
g.status = "ready"; g.status = "ready";

View File

@ -1,10 +1,9 @@
import { WebSocketHandler } from "bun";
import { createRouter } from "radix3"; import { createRouter } from "radix3";
import { wsHandler } from "../../../app/srv/ws/handler"; import { wsHandler } from "../../../app/srv/ws/handler";
import { dir } from "../utils/dir"; import { dir } from "../utils/dir";
import { g } from "../utils/global"; import { g } from "../utils/global";
import { serveAPI } from "./serve-api"; import { serveAPI } from "./serve-api";
import { WebSocketHandler } from "bun";
import { waitUntil } from "web-utils/src/wait-until";
const cache = { const cache = {
static: {} as Record< static: {} as Record<
@ -56,6 +55,7 @@ export const createServer = async () => {
} as WebSocketHandler<WSData>, } as WebSocketHandler<WSData>,
async fetch(req, server) { async fetch(req, server) {
const url = new URL(req.url); const url = new URL(req.url);
console.log(req.url);
if (wsHandler[url.pathname]) { if (wsHandler[url.pathname]) {
if ( if (