Upload files to "/"

This commit is contained in:
2026-04-04 20:14:59 +00:00
parent c9e66faf58
commit fbf1b25423
2 changed files with 32 additions and 0 deletions

26
start-java.ts Normal file
View File

@@ -0,0 +1,26 @@
import fs from "node:fs";
import child_process from "node:child_process";
type Properties = {
"jar-file": string,
"terminal"?: boolean,
"minimum-mem"?: string,
"maximum-mem"?: string
}
let jvm_properties: Properties = JSON.parse(fs.readFileSync("jvm-properties.json", { encoding: "utf8" }));
if (jvm_properties["jar-file"] === undefined) throw new Error("`jar-file` is a required option.");
if (jvm_properties["terminal"] === undefined) jvm_properties["terminal"] = false;
if (jvm_properties["minimum-mem"] === undefined) jvm_properties["minimum-mem"] = "1G";
if (jvm_properties["maximum-mem"] === undefined) jvm_properties["maximum-mem"] = "4G";
let subprocess = child_process.spawn(jvm_properties["terminal"] ? "java" : "javaw",
[`-Xms${ jvm_properties["minimum-mem"] }`,
`-Xmx${ jvm_properties["maximum-mem"] }`,
"-jar", jvm_properties["jar-file"]],
{ stdio: "ignore", detached: true, windowsHide: !jvm_properties["terminal"] }
);
subprocess.unref();

6
tsconfig.json Normal file
View File

@@ -0,0 +1,6 @@
{
"compilerOptions":
{
"module": "es6"
}
}