title: Sinatra: run ruby code when a URL is hit
body: <p>I want to run a script (code.rb) every time the url /code is hit.</p>
  
  <p>How do I run the script?</p>
  
  <pre><code>require 'sinatra'
  get '/' do
    #run the script
  end
  </code></pre>