Sha256: 8bdd09b53fd4a31d7d8d85741c963fcafb281f240fb39f731ff4ba71f8c51247

Contents?: true

Size: 673 Bytes

Versions: 30

Compression:

Stored size: 673 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

30 entries across 30 versions & 3 rubygems

Version Path
tipi-0.43 examples/http_server.js
tipi-0.42 examples/http_server.js
tipi-0.41 examples/http_server.js
tipi-0.40 examples/http_server.js
tipi-0.39 examples/http_server.js
tipi-0.38 examples/http_server.js
tipi-0.37.2 examples/http_server.js
tipi-0.37.1 examples/http_server.js
tipi-0.37 examples/http_server.js
tipi-0.36 examples/http_server.js
tipi-0.35 examples/http_server.js
tipi-0.34 examples/http_server.js
tipi-0.33 examples/http_server.js
tipi-0.32 examples/http_server.js
tipi-0.31 examples/http_server.js
tipi-0.30 examples/http_server.js
polyphony-http-0.28 examples/http_server.js
polyphony-http-0.27 examples/http_server.js
polyphony-http-0.26 examples/http_server.js
polyphony-http-0.25 examples/http_server.js