diff --git a/bun/bun.lockb b/bun/bun.lockb new file mode 100755 index 0000000..ec24c6b Binary files /dev/null and b/bun/bun.lockb differ diff --git a/bun/hello.test.ts b/bun/hello.test.ts new file mode 100644 index 0000000..f4840f7 --- /dev/null +++ b/bun/hello.test.ts @@ -0,0 +1,7 @@ +import { test, expect } from "bun:test"; +import hello from "./hello"; + +test("response", async () => { + const res = hello.fetch(new Request("")); + expect(await res.text()).toBe("Hello, World!"); +}); diff --git a/bun/hello.ts b/bun/hello.ts new file mode 100644 index 0000000..db3c158 --- /dev/null +++ b/bun/hello.ts @@ -0,0 +1,6 @@ +export default { + port: 3000, + fetch(request: Request) { + return new Response("Hello, World!"); + }, +}; diff --git a/bun/package.json b/bun/package.json new file mode 100644 index 0000000..a8bb50a --- /dev/null +++ b/bun/package.json @@ -0,0 +1,9 @@ +{ + "name": "bun-example", + "scripts": { + "test": "bun wiptest" + }, + "dependencies": { + "bun-types": "^0.0.83" + } +} diff --git a/bun/tsconfig.json b/bun/tsconfig.json new file mode 100644 index 0000000..9e94749 --- /dev/null +++ b/bun/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "lib": ["esnext"], + "types": ["bun-types"] + } +}