This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var client = http.createClient(81, 'localhost'); | |
var request = client.request('GET', '/'); | |
request.end(); | |
request.on('response', function (response) { | |
console.log('STATUS: ' + response.statusCode); | |
console.log('HEADERS: ' + JSON.stringify(response.headers)); | |
response.setEncoding('utf8'); | |
response.on('data', function (chunk) { | |
console.log('BODY: ' + chunk); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :populate_db do | |
begin | |
require 'rubygems' | |
require 'json' | |
require 'couchrest' | |
rescue | |
puts "Ruby gems missing, trying to install with sudo rights" | |
sh 'sudo gem install json couchrest' | |
retry | |
end |
NewerOlder