MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add h3 demo and update node:http shim

+39
examples/npm/h3/ant.lockb

This is a binary file and will not be displayed.

+15
examples/npm/h3/index.ts
··· 1 + import { H3, serve } from 'h3'; 2 + 3 + const app = new H3({ 4 + onRequest: event => { 5 + console.log('Request:', event.req.url); 6 + }, 7 + onResponse: (response, event) => { 8 + console.log('Response:', event.url.pathname, response.status); 9 + }, 10 + onError: error => { 11 + console.error(error); 12 + } 13 + }).get('/', () => 'hello world'); 14 + 15 + serve(app, { port: 3000 });
+12
examples/npm/h3/package.json
··· 1 + { 2 + "name": "h3", 3 + "type": "module", 4 + "main": "index.ts", 5 + "scripts": { 6 + "start": "ant index.ts" 7 + }, 8 + "dependencies": { 9 + "h3": "^2.0.1-rc.20" 10 + }, 11 + "devDependencies": {} 12 + }
+7
examples/npm/h3/tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "strict": true, 4 + "jsx": "react-jsx", 5 + "jsxImportSource": "hono/jsx" 6 + } 7 + }
+5
src/builtins/node/http.mjs
··· 813 813 let keepAlive = false; 814 814 815 815 if (this.writableEnded) return this; 816 + if (typeof chunk === 'function') { 817 + callback = chunk; 818 + chunk = undefined; 819 + encoding = undefined; 820 + } 816 821 if (typeof encoding === 'function') { 817 822 callback = encoding; 818 823 encoding = undefined;