Sha256: 6ab3328b1fe68fb2f9b616af4e73ddd4879461bc6a531447e81b87058be549fa

Contents?: true

Size: 671 Bytes

Versions: 10

Compression:

Stored size: 671 Bytes

Contents

// For the sake of comparing performance, here's a node.js-based HTTP server
// doing roughly the same thing as http_server. Preliminary benchmarking shows
// the ruby version has a throughput (req/s) of about 2/3 of the JS version.

const http = require('http');

const MSG = 'Hello World';

const server = http.createServer((req, res) => {
  // let requestCopy = {
  //   method: req.method,
  //   request_url: req.url,
  //   headers: req.headers
  // };

  // res.writeHead(200, { 'Content-Type': 'application/json' });
  // res.end(JSON.stringify(requestCopy));

  res.writeHead(200);
  res.end(MSG)
});

server.listen(1235);
console.log('Listening on port 1235');

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tipi-0.55 examples/http_server.js
tipi-0.54 examples/http_server.js
tipi-0.53 examples/http_server.js
tipi-0.52 examples/http_server.js
tipi-0.51 examples/http_server.js
tipi-0.50 examples/http_server.js
tipi-0.49 examples/http_server.js
tipi-0.47 examples/http_server.js
tipi-0.46 examples/http_server.js
tipi-0.45 examples/http_server.js