cleanup, automatically reconnect servers
This commit is contained in:
+9
-1
@@ -1,6 +1,8 @@
|
||||
import { PACKAGE_FILE, STATIC_DIR } from ".";
|
||||
|
||||
import Colors from "colors";
|
||||
import Fs from "fs/promises";
|
||||
import { PACKAGE_FILE } from ".";
|
||||
import Path from "path";
|
||||
import { WebSocketMessage } from "./websocket-handler";
|
||||
|
||||
// CONFIG
|
||||
@@ -22,6 +24,12 @@ export async function getVersionNumber(): Promise<string> {
|
||||
}
|
||||
}
|
||||
|
||||
// SERVER
|
||||
export function createFileResponse(requestPath: string): Response {
|
||||
const fullPath = Path.join(STATIC_DIR, requestPath);
|
||||
return new Response(Bun.file(fullPath));
|
||||
}
|
||||
|
||||
// OUTPUT
|
||||
async function writeToLogFile(message: string): Promise<void> {
|
||||
await Fs.appendFile("logs", `${message}\n`);
|
||||
|
||||
Reference in New Issue
Block a user