mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-10 07:31:27 -07:00
Initial commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export type Env = {
|
||||
// add bindings here
|
||||
}
|
||||
@@ -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!"`)
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { Env } from './context'
|
||||
|
||||
export default {
|
||||
fetch: (_request, _env, _ctx) => {
|
||||
return new Response('hello, world!')
|
||||
},
|
||||
} satisfies ExportedHandler<Env>
|
||||
Reference in New Issue
Block a user