title: Sinatra with optional query parameters
body: <p>I want to create a Sinatra API route with optional query parameters.I'm able to add the query parameters as follows</p>
  
  <blockquote>
    <p>%r{^/mysql/data/(?)/start_time=(?\w*)/?}</p>
  </blockquote>
  
  <p>But the route corresponding to the above route is like "/mysql/data/:name/start_time=:start_time"</p>
  
  <p>I need the query parameters as optional and to be declared in URL format.</p>
  
  <p>Eg:</p>
  
  <blockquote>
    <p>/mysql/data/:name?start_time=:start_time&amp;end_time=:end_time</p>
  </blockquote>
  
  <p>Is there any way in Sinatra to do this?</p>