Skip to content

Instantly share code, notes, and snippets.

@codeincontext
Last active December 10, 2015 19:08
Show Gist options
  • Select an option

  • Save codeincontext/4479523 to your computer and use it in GitHub Desktop.

Select an option

Save codeincontext/4479523 to your computer and use it in GitHub Desktop.
Simple counter node server (cache testing)
var http = require('http');
var number = 0;
http.createServer(function (req, res) {
if (req.url == '/') number++;
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(number.toString());
}).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment