nose-pluto/nose/bin/apps.tsx
2025-09-21 21:41:29 -07:00

17 lines
488 B
TypeScript

import { $ } from "bun"
import { apps } from "@/webapp"
const devMode = process.env.BUN_HOT
export default async function () {
const hostname = await $`hostname`.quiet()
let domain = devMode ? "localhost" : hostname.toString()
if (!devMode && !domain.endsWith(".local")) domain += ".local"
let port = process.env.PORT || "3000"
port = port === "80" ? "" : `:${port}`
return <>
{apps().map(app => <><a href={`http://${app}.${domain}${port}`}>{app}</a>{" "}</>)}
</>
}