Search code examples
rubysinatrairb

How to call a Sinatra route from IRB console


I loaded my app into IRB console by typing irb into bash then in the console using:

require 'myapp.rb'

It all worked successfully, now I want to call one of my routes.

get '/stuff' do
  '<HTML><BODY><CENTER>App is up and running! '\
  'Less logging...</CENTER></BODY></HTML>'
end

How can I use IRB console to test this route?


Solution

  • I discovered the Tux gem. It allows calling of get and post routes from within IRB console.