mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-21 14:46:55 +08:00
Add the GPUI workspace, native Metal dictation HUD, explicit local meeting capture and detection, single-listener lifecycle, signed app packaging, and the supporting prototypes and documentation.
21 lines
688 B
TypeScript
21 lines
688 B
TypeScript
// PROTOTYPE: local static server for app-shell comparisons.
|
|
import { join, normalize } from "node:path"
|
|
|
|
const root = import.meta.dir
|
|
const port = 4173
|
|
|
|
Bun.serve({
|
|
port,
|
|
async fetch(request) {
|
|
const url = new URL(request.url)
|
|
const pathname = url.pathname === "/" ? "/index.html" : decodeURIComponent(url.pathname)
|
|
const path = normalize(join(root, pathname))
|
|
if (!path.startsWith(root)) return new Response("Not found", { status: 404 })
|
|
const file = Bun.file(path)
|
|
if (!(await file.exists())) return new Response("Not found", { status: 404 })
|
|
return new Response(file)
|
|
},
|
|
})
|
|
|
|
console.log(`Voice Control app-shell prototype: http://localhost:${port}`)
|