everything

This commit is contained in:
elijahr2411
2023-01-31 22:00:30 -05:00
commit 3235375581
14 changed files with 919 additions and 0 deletions

29
src/index.ts Normal file
View File

@@ -0,0 +1,29 @@
import * as toml from 'toml';
import IConfig from './IConfig';
import * as fs from "fs";
import WSServer from './WSServer';
import QEMUVM from './QEMUVM';
// Parse the config file
var Config : IConfig;
if (!fs.existsSync("config.toml")) {
console.error("config.toml not found. Please copy config.example.toml to config.toml and fill out fields.");
process.exit(1);
}
try {
var configRaw = fs.readFileSync("config.toml").toString();
Config = toml.parse(configRaw);
} catch (e) {
console.error(`Failed to read or parse the config file: ${e}`);
process.exit(1);
}
// Fire up the VM
var VM = new QEMUVM(Config);
VM.Start();
// Start up the websocket server
var WS = new WSServer(Config);
WS.listen();