From e00a6c74182f28a85a584f8713bb5f965970f016 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Mon, 1 Dec 2025 10:54:24 +0800 Subject: [PATCH] test --- src/test/listen-ip.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/listen-ip.ts diff --git a/src/test/listen-ip.ts b/src/test/listen-ip.ts new file mode 100644 index 0000000..56f4689 --- /dev/null +++ b/src/test/listen-ip.ts @@ -0,0 +1,18 @@ +// import { Server } from 'node:http'; +import { Server } from '../server/server.ts' + +const server = new Server({ + path: '/', + handle: async (data, ctx) => { + console.log('ctx', ctx.req.url) + console.log('Received data:', data); + + ctx.res.writeHead(200, { 'Content-Type': 'application/json' }); + return JSON.stringify({ code: 200, message: 'Success', data }); + } +}); + +server.listen(51015, '0.0.0.0', () => { + console.log('Server is listening on http://localhost:3000'); +}); +