feat: Implemented launching and downloading of roms

This is just an initial implementation lots of kings to iron out
This commit is contained in:
Simeon Radivoev 2026-02-19 16:10:29 +02:00
parent ef08fa6114
commit f15bf9a1e0
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
117 changed files with 37776 additions and 1073 deletions

View file

@ -1,16 +1,17 @@
import { RPC_PORT } from "../../shared/constants";
import { settings } from "./settings";
import { romm } from "./clients";
import Elysia from "elysia";
import { cors } from "@elysiajs/cors";
import Elysia from "elysia";
import { RPC_PORT } from "../../shared/constants";
import { host } from "../utils";
import clients from "./clients";
import { settings } from "./settings";
import { system } from "./system";
const api = new Elysia({ prefix: "/api", serve: {} })
.use(cors())
.use(romm)
.use(settings);
const api = new Elysia({ serve: {} })
.use([cors(), clients, settings, system]);
export type AppType = typeof api;
export type RommAPIType = typeof clients;
export type SettingsAPIType = typeof settings;
export type SystemAPIType = typeof system;
export function RunAPIServer ()
{
@ -19,24 +20,11 @@ export function RunAPIServer ()
apiServer: api.listen({
port: RPC_PORT,
hostname: host,
development: process.env.NODE_ENV === 'development',
fetch (req, server)
{
if (server.upgrade(req, {
data: undefined
}))
{
return;
}
return api.fetch(req);
},
websocket: {
message (ws, message)
{
development: process.env.NODE_ENV === 'development'
}),
async cleanup ()
{
},
}
})
}
};
}