Last active
December 28, 2015 06:49
-
-
Save tkfm-yamaguchi/7459910 to your computer and use it in GitHub Desktop.
This file contains 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
get %r|^/github(/.+\.js)$| do | |
require 'net/https' | |
uri = params[:captures].first | |
js = "" | |
github = Net::HTTP.new("raw.github.com", 443) | |
github.use_ssl = true # do not forget this to access with HTTPS protocol | |
github.start do | |
## XXX: verify the http response status | |
js = github.get(uri).body | |
end | |
response["Content-Type"] = "application/javascript" | |
js | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment