Skip to content

Commit 24dfdf7

Browse files
committed
added node
1 parent 7742f5a commit 24dfdf7

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

http/bun/benchmark.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
var t=Bun.serve({port:3000,fetch(c){return new Response("Welcome to Bun!")}});console.log(`Listening on localhost:${t.port}`);

http/go/benchmark

6.18 MB
Binary file not shown.

http/node/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const http = require('http');
2+
3+
const hostname = '127.0.0.1';
4+
const port = 3000;
5+
6+
const server = http.createServer((req, res) => {
7+
res.statusCode = 200;
8+
res.setHeader('Content-Type', 'text/plain');
9+
res.end('Hello From node');
10+
});
11+
12+
server.listen(port, hostname, () => {
13+
console.log(`Server running at http://${hostname}:${port}/`);
14+
});

0 commit comments

Comments
 (0)