From b57aed93590c59b314addf5abfdc7ff7efbc6ae7 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Thu, 7 Jul 2022 14:41:34 +0900 Subject: [PATCH] create bun --- bun/bun.lockb | Bin 0 -> 1073 bytes bun/hello.test.ts | 7 +++++++ bun/hello.ts | 6 ++++++ bun/package.json | 9 +++++++++ bun/tsconfig.json | 8 ++++++++ 5 files changed, 30 insertions(+) create mode 100755 bun/bun.lockb create mode 100644 bun/hello.test.ts create mode 100644 bun/hello.ts create mode 100644 bun/package.json create mode 100644 bun/tsconfig.json diff --git a/bun/bun.lockb b/bun/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..ec24c6b90b49f0757e73c440a773fdb4afd654d1 GIT binary patch literal 1073 zcmY#Z)GsYA(of3F(@)JSQ%EY!;{sycoc!eMw9K4T-L(9o+{6;yG6OC~1_lNt>wvFk zc60pj+2k#rb}eZQJ5xdXw4J8s^OQawDrQwaGm{yp2nd)U6axp8W{1)ZFmadyC?7&` zGBCgtFjT)uKieVnT8Z&Hv*ew1Ck!_*@<#BoGB7;Yl5+S@JwjUoj1O`i5@1?`sxBBw zjt~=M6tZ!s{D1uakR=HjMx;C=1H@cpqgiHIST>%zXKi}+`*WX_3T*TH41#uc?m4s7 zwZQTnG+fTT&E?~$VYd-e+G}Sj$F$C)LaJ%{W`BNOvv|$jAiMe5!QqB%E(0{o92l9w za=>tBuz5hpp&OpyV&%&4?5^4&J=CX0EC`m2KOUwx_Day=Cw^J}gm}&txwF9bc ZBHR%m2N>eAAC&1zDhpDJVF5Q-X#fDqvI_tJ literal 0 HcmV?d00001 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"] + } +}