wip fix
This commit is contained in:
parent
eb3ab69d18
commit
27af6c01af
|
|
@ -1,8 +1,7 @@
|
||||||
import { existsAsync } from "fs-jetpack";
|
|
||||||
import { g } from "utils/global";
|
|
||||||
import { code } from "./util-code";
|
|
||||||
import type { Server, WebSocketHandler } from "bun";
|
import type { Server, WebSocketHandler } from "bun";
|
||||||
import _fs from "node:fs/promises";
|
import _fs from "node:fs/promises";
|
||||||
|
import { g } from "utils/global";
|
||||||
|
import { code } from "./util-code";
|
||||||
|
|
||||||
type PrasiServer = {
|
type PrasiServer = {
|
||||||
ws?: WebSocketHandler<{ url: string }>;
|
ws?: WebSocketHandler<{ url: string }>;
|
||||||
|
|
@ -14,7 +13,8 @@ type PrasiServer = {
|
||||||
}) => Promise<Response>;
|
}) => Promise<Response>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const _server = {
|
if (!g._server) {
|
||||||
|
g._server = {
|
||||||
handler: {} as Record<string, PrasiServer>,
|
handler: {} as Record<string, PrasiServer>,
|
||||||
init_timeout: null as any,
|
init_timeout: null as any,
|
||||||
init(site_id: string) {
|
init(site_id: string) {
|
||||||
|
|
@ -61,9 +61,6 @@ const _server = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!g._server) {
|
|
||||||
g._server = _server;
|
|
||||||
}
|
}
|
||||||
export const server = g._server;
|
export const server = g._server;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue