Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
require 'net/http' | |
require 'json' | |
def get_json(uri) | |
url = URI.parse(uri) | |
req = Net::HTTP::Get.new(url, {'Accept' => "application/json"}) | |
res = Net::HTTP.start(url.host, url.port) {|http| | |
http.request(req) | |
} |