/** @jsxImportSource hono/jsx */ import { Hype } from '@because/hype' import { PhonePage, stylesToCSS } from '../pages/phone' import { startup } from './terminal' const PORT = Number(process.env.PORT) || 3000 const app = new Hype({ layout: false, logging: false }) app.get('/ok', c => c.text('ok')) app.get('/styles.css', c => c.text(stylesToCSS(), 200, { 'Content-Type': 'text/css; charset=utf-8' }) ) app.get('/', c => c.html()) app.get('/ggwave.js', () => new Response(Bun.file(new URL(import.meta.resolve('ggwave/ggwave.js')).pathname), { headers: { 'Content-Type': 'application/javascript' }, }) ) startup(PORT) export default { ...app.defaults, port: PORT, idleTimeout: 255, tls: { key: Bun.file('./certs/key.pem'), cert: Bun.file('./certs/cert.pem'), }, }