Apparently Sinatra does have some support for optional settings. The following makes the trailing slash optional:
get '/my/route/?'

I wonder how it's being done. We can try a weird regex to catch these, but perhaps it should be written as a regex instead in the first place.

Sukria, can you verify whether Sinatra are using regex for routes or just have a tricky regex to handle route compilation and optional parameters?