Initial commit
Some checks failed
NPM Audit Check / Check NPM audit (push) Has been cancelled
App Image CI / Build app image (push) Has been cancelled

This commit is contained in:
2025-10-09 18:48:59 -05:00
commit 237d076668
17 changed files with 2357 additions and 0 deletions

28
src/index.ts Normal file
View File

@@ -0,0 +1,28 @@
import fs from 'fs';
import path from 'path';
import JSON5 from 'json5';
import { Web, type WebConfig } from './Web.js';
interface compositeConfig {
web?: WebConfig
}
async function readConfig(): Promise<compositeConfig> {
try {
return JSON5.parse(await fs.promises.readFile(process.env['config'] || process.env['CONFIG'] || path.join(process.cwd(), 'config', 'config.jsonc'), 'utf-8'));
}
catch (err) {
console.error('No config file found, using default config');
console.error(err);
return {};
}
}
const config: compositeConfig = await readConfig();
const web = new Web(config.web);
await web.initialize();
process.on('SIGTERM', () => {
web.close();
});