mirror of
https://github.com/kou029w/_.git
synced 2025-01-30 22:08:02 +00:00
create bun
This commit is contained in:
parent
f4ec67dbc4
commit
b57aed9359
5 changed files with 30 additions and 0 deletions
BIN
bun/bun.lockb
Executable file
BIN
bun/bun.lockb
Executable file
Binary file not shown.
7
bun/hello.test.ts
Normal file
7
bun/hello.test.ts
Normal file
|
@ -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!");
|
||||
});
|
6
bun/hello.ts
Normal file
6
bun/hello.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
export default {
|
||||
port: 3000,
|
||||
fetch(request: Request) {
|
||||
return new Response("Hello, World!");
|
||||
},
|
||||
};
|
9
bun/package.json
Normal file
9
bun/package.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "bun-example",
|
||||
"scripts": {
|
||||
"test": "bun wiptest"
|
||||
},
|
||||
"dependencies": {
|
||||
"bun-types": "^0.0.83"
|
||||
}
|
||||
}
|
8
bun/tsconfig.json
Normal file
8
bun/tsconfig.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["esnext"],
|
||||
"types": ["bun-types"]
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue