gpt-4o-mini-2024-07-18· OpenAI
WildChat-4.8M (AI2)
Description: create a node.js server with port 400 Generate source code based on the…
- User
Description: create a node.js server with port 400
Generate source code based on the description above and respond in the following JSON format ONLY: ```json { "name": "prompt_name", "schema": { "type": "string", "code": "Generated code here" } } ``` IMPORTANT: - Ensure the JSON response is error-free. - Include no additional text or explanations. Respond with the JSON object only. - Assistant
{ "name": "node_js_server", "schema": { "type": "string", "code": "const http = require('http');\n\nconst PORT = 400;\n\nconst requestListener = (req, res) => {\n\tres.writeHead(200, { 'Content-Type': 'text/plain' });\n\tres.end('Server is running on port 400');\n};\n\nconst server = http.createServer(requestListener);\n\nserver.listen(PORT, () => {\n\tconsole.log(`Server is running on http://localhost:${PORT}`);\n});" } }