Skip to content

Instantly share code, notes, and snippets.

@joshkehn
Created October 3, 2011 02:38
Show Gist options
  • Select an option

  • Save joshkehn/1258318 to your computer and use it in GitHub Desktop.

Select an option

Save joshkehn/1258318 to your computer and use it in GitHub Desktop.
var http = require('http');
function fibonacci(n) {
if (n < 2)
return 1;
else
return fibonacci(n-2) + fibonacci(n-1);
}
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type' : 'text/plain'});
res.end(fibonacci(40) + '');
}).listen(1337);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment