Sha256: 157f32dbd9c3d88d8744a757566335d3bff7162ff33548db68db0e6b6f197746
Contents?: true
Size: 401 Bytes
Versions: 12
Compression:
Stored size: 401 Bytes
Contents
$:.push(File.dirname(__FILE__) + "/../lib") # Just run `ruby examples/custom_headers.rb` and then use something like # `curl -i http://localhost:2345/api/v1/`. require "rack/api" Rack::API.app do prefix "api" version :v1 do get "/" do headers["X-Awesome"] = "U R Awesome!" {:message => "Hello, awesome API!"} end end end Rack::Handler::Thin.run Rack::API, :Port => 2345
Version data entries
12 entries across 12 versions & 1 rubygems