aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/http.exports.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-11-16Make `node:http`.createServer work betterGravatar Jarred Sumner 1-36/+81
2022-11-09Add bun-types, add typechecking, add `child_process` types (#1475)Gravatar Colin McDonnell 1-5/+5
* Add bun-types to packages * Improve typing * Fix types in tests * Fix dts tests * Run formatter * Fix all type errors * Add strict mode, fix type errors * Add ffi changes * Move workflows to root * Add workflows * Remove labeler * Add child_process types * Fix synthetic defaults issue * Remove docs * Move scripts * Run prettier * Include examples in typechecking * captureStackTrace types * moved captureStackTrace types to globals * Address reviews Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2022-10-05Temporary hack so `res.socket` in node:http doesn't throwGravatar Jarred Sumner 1-1/+7
2022-08-22woopsGravatar Jarred Sumner 1-1/+0
2022-08-22[node:http] speed up assigning headersGravatar Jarred Sumner 1-55/+41
2022-08-2238% faster `node:http`Gravatar Jarred Sumner 1-77/+203
Before: ```fish ❯ oha http://localhost:3000 -z 2s -c 20 Summary: Success rate: 1.0000 Total: 2.0006 secs Slowest: 0.0095 secs Fastest: 0.0000 secs Average: 0.0003 secs Requests/sec: 69521.0420 ``` After: ``` ❯ oha http://localhost:3000 -z 2s -c 20 Summary: Success rate: 1.0000 Total: 2.0005 secs Slowest: 0.0063 secs Fastest: 0.0000 secs Average: 0.0002 secs Requests/sec: 109119.8614 ``` Code ``` const http = require("http"); const hostname = "127.0.0.1"; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader("Content-Type", "text/plain"); res.end("Hello World!"); }); server.listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`); }); ```
2022-08-03use import.meta.require instead of import (#973)Gravatar Zilin Zhu 1-2/+2
2022-07-13add node:http Server polyfill (#572)Gravatar evan 1-0/+540
* node:http polyfill * remove @ts-ignore * reuse emitter instance * requested changes * cleanup Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>