Resolve conflicts: accept server split, apply hint reorder to terminal.ts, add JSX pragma to phone.tsx Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
811 B
TypeScript
34 lines
811 B
TypeScript
/** @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(<PhonePage />))
|
|
|
|
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'),
|
|
},
|
|
}
|