[link] stub

This commit is contained in:
Devin Zuczek
2026-08-20 18:52:14 -04:00
parent 3e59ebeaa8
commit 062c07cc33
10 changed files with 14804 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import type { HonoApp } from '@repo/hono-helpers'
import type { SharedHonoEnv, SharedHonoVariables } from '@repo/hono-helpers/src/types'
export type Env = SharedHonoEnv & {
/**
* Shared Secrets Store binding for the HS256 JWT signing key. Resolve the value with
* `await env.JWT_SECRET.get()`; every worker binds the same store, so tokens signed by
* `auth` verify here.
*/
JWT_SECRET: SecretsStoreSecret
}
/** Variables can be extended */
export type Variables = SharedHonoVariables
export interface App extends HonoApp {
Bindings: Env
Variables: Variables
}
+26
View File
@@ -0,0 +1,26 @@
import { Hono } from 'hono'
import { useWorkersLogger } from 'workers-tagged-logger'
import { withNotFound, withOnError } from '@repo/hono-helpers'
import type { App } from './context'
const app = new Hono<App>()
.use(
'*',
// middleware
(c, next) =>
useWorkersLogger(c.env.NAME, {
environment: c.env.ENVIRONMENT,
release: c.env.SENTRY_RELEASE,
})(c, next)
)
.onError(withOnError())
.notFound(withNotFound())
.get('/', async (c) => {
return c.text('hello, world!')
})
export default app
@@ -0,0 +1,8 @@
import { SELF } from 'cloudflare:test'
import { expect, it } from 'vitest'
it('response with hello world', async () => {
const res = await SELF.fetch('https://example.com')
expect(res.status).toBe(200)
expect(await res.text()).toMatchInlineSnapshot(`"hello, world!"`)
})