-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_http_final.js
More file actions
31 lines (25 loc) · 1.03 KB
/
test_http_final.js
File metadata and controls
31 lines (25 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Final HTTP Server Test
import http from 'node:http';
console.log('🚀 Starting Z8 HTTP Server with native IOCP...\n');
const server = http.createServer((req, res) => {
console.log(`📨 ${req.method} ${req.url}`);
res.writeHead(200, {
'Content-Type': 'text/plain',
'X-Powered-By': 'Z8-IOCP',
'X-Runtime': 'Z8 JavaScript Runtime'
});
res.end('Hello from Z8 with native Windows IOCP!\n' +
'This is a high-performance HTTP server running on native IOCP backend.\n' +
'No libuv dependency - pure Windows I/O Completion Ports!\n');
});
server.listen(3000, '127.0.0.1', () => {
console.log('✅ Server is listening on http://127.0.0.1:3000');
console.log('📊 Backend: Windows IOCP (native)');
console.log('🔥 Zero libuv dependency');
console.log('\n💡 Test with: curl http://127.0.0.1:3000');
console.log(' Or open in your browser\n');
});
// Keep server alive
setInterval(() => {
// Server heartbeat
}, 5000);