UNPKG

@nomyx/assistant

Version:

A powerful assistant library and cli for your AI projects. works with Vertex AI (Claude and Gemini)

20 lines (18 loc) 606 B
const http = require('http'); const server = http.createServer((req, res) => { if (req.url === '/') { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello, World!'); } else if (req.url === '/time') { res.writeHead(200, {'Content-Type': 'text/plain'}); const currentTime = new Date().toLocaleString(); res.end(`Current date and time: ${currentTime}`); } else { res.writeHead(404, {'Content-Type': 'text/plain'}); res.end('Not Found'); } }); const PORT = 3000; server.listen(PORT, () => { console.log(`Server is running on http://localhost:${PORT}`); });