fix: Fixed cross platform errors and emulatorjs not opening on linux

This commit is contained in:
Simeon Radivoev 2026-03-15 16:43:07 +02:00
parent f33c928633
commit df20979afa
Signed by: simeonradivoev
GPG key ID: C16C2132A7660C8E
6 changed files with 39 additions and 18 deletions

View file

@ -12,25 +12,25 @@ export function RunBunServer ()
console.log("Launching Server on port ", SERVER_PORT);
return new Elysia()
.use(cors())
.headers({
'cross-origin-embedder-policy': 'credentialless',
'cross-origin-opener-policy': 'same-origin',
'cross-origin-resource-policy': 'cross-origin'
})
.get("/", ({ set }) =>
{
set.headers['cross-origin-opener-policy'] = 'same-origin';
set.headers['cross-origin-embedder-policy'] = 'require-corp';
return file("./dist/index.html");
return Bun.file(appPath("./dist/index.html"));
})
.get('/emulatorjs', ({ set }) =>
{
set.headers['cross-origin-opener-policy'] = 'same-origin';
set.headers['cross-origin-embedder-policy'] = 'require-corp';
set.headers['cross-origin-resource-policy'] = 'cross-origin';
return file('./dist/emulatorjs/index.html');
return Bun.file(appPath('./dist/emulatorjs/index.html'));
})
.use(staticPlugin({
indexHTML: false,
assets: "dist",
assets: appPath("./dist"),
prefix: "/",
alwaysStatic: true
})).listen({ port: SERVER_PORT, hostname: host }, console.log);
})).listen({ port: SERVER_PORT, hostname: host, development: true }, console.log);
/*return Bun.serve({
port: SERVER_PORT,
hostname: host,