Sha256: 0f5d72bd68ecb98d103c06b9d245eda9a169abe7a141e685d90107055a9fd6cf
Contents?: true
Size: 452 Bytes
Versions: 72
Compression:
Stored size: 452 Bytes
Contents
require 'rack' require 'pry' class Echo def initialize(app) @app = app end def call(env) request = Rack::Request.new(env) if request.path_info == "/echo" if output = request.body return [200, {}, output.body] else return [200, {}, ["Hello World?"]] end else return @app.call(env) end end end use Echo use Rack::Static, :urls => [''], :root => 'public', :index => 'index.html' run lambda{|env| [404, {}, []]}
Version data entries
72 entries across 72 versions & 1 rubygems