index.ts
This file
Path
runtime-tests/workerd/index.ts
18 lines 路 466 bytes 路 TypeScript
Last changed by
test: move adapter runtime tests into `adapters/*` (#5466)Yusuke Wadabefore adoption645ddd6
History of this fileTake it
12345678910111213141516171819import { env, getRuntimeKey } from '../../src/helper/adapter'import { Hono } from '../../src/hono'import { getColorEnabledAsync } from '../../src/utils/color'
const app = new Hono()
app.get('/', (c) => c.text(`Hello from ${getRuntimeKey()}`))
app.get('/env', (c) => { const { NAME } = env<{ NAME: string }>(c) return c.text(NAME)})
app.get('/color', async (c) => { return c.text((await getColorEnabledAsync()) ? 'True' : 'False')})
export default app