UNPKG

cluster-service

Version:

Turns your single process code into a fault-resilient multi-process service with built-in REST & CLI support

9 lines (8 loc) 297 B
var http = require('http'); var app = http.createServer(function (req, res) { setTimeout(function() { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }, 2000).unref(); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');