Node: Simple HTTP server, function separated for demonstration