Sha256: d6dc984b01f33b6dbaf0802f36a3657fa884beb984d060f048f716354614b509
Contents?: true
Size: 618 Bytes
Versions: 11
Compression:
Stored size: 618 Bytes
Contents
#!/usr/bin/env ruby $:<< '../lib' << 'lib' # # Example of using "config/conf_test.rb" during server initialization # - options parser allows us to extend the command line parameters for API # - config file shows loading of environment specific, global, and shared variables # require 'goliath' class ConfTest < Goliath::API use Goliath::Rack::Params use Goliath::Rack::Render, 'json' def options_parser(opts, options) options[:test] = 0 opts.on('-t', '--test NUM', "The test number") { |val| options[:test] = val.to_i } end def response(env) [200, {}, {:response => env.config}] end end
Version data entries
11 entries across 11 versions & 1 rubygems