Skip to content

Commit 0f3a0e9

Browse files
committed
added code for benchmarks
1 parent 02dec70 commit 0f3a0e9

File tree

5 files changed

+1254
-3
lines changed

5 files changed

+1254
-3
lines changed

bun/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
console.log("Hello via Bun!");
1+
const server = Bun.serve({
2+
port: 3000,
3+
fetch(request) {
4+
return new Response("Welcome to Bun!");
5+
},
6+
});
7+
8+
console.log(`Listening on localhost:${server.port}`);

go/cmd/main.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"io"
6+
"net/http"
7+
)
8+
9+
func getRoot(w http.ResponseWriter, r *http.Request) {
10+
io.WriteString(w, "Hello from GO!\n")
11+
}
12+
13+
func main() {
14+
http.HandleFunc("/", getRoot)
15+
16+
err := http.ListenAndServe(":3000", nil)
17+
if err != nil {
18+
panic(err)
19+
}
20+
fmt.Println("Listening on port 3000")
21+
}

0 commit comments

Comments
 (0)