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 _fs from "node:fs/promises";
|
||||
import { g } from "utils/global";
|
||||
import { code } from "./util-code";
|
||||
|
||||
type PrasiServer = {
|
||||
ws?: WebSocketHandler<{ url: string }>;
|
||||
|
|
@ -14,7 +13,8 @@ type PrasiServer = {
|
|||
}) => Promise<Response>;
|
||||
};
|
||||
|
||||
const _server = {
|
||||
if (!g._server) {
|
||||
g._server = {
|
||||
handler: {} as Record<string, PrasiServer>,
|
||||
init_timeout: null as any,
|
||||
init(site_id: string) {
|
||||
|
|
@ -62,8 +62,5 @@ const _server = {
|
|||
}
|
||||
},
|
||||
};
|
||||
|
||||
if (!g._server) {
|
||||
g._server = _server;
|
||||
}
|
||||
export const server = g._server;
|
||||
|
|
|
|||
Loading…
Reference in New Issue