Today, when building a web application, you very likely need to provide a web API. In Ruby, both web frameworks Rails or Sinatra are common options.
If you need something simpler and lighter than Rails but that doesn't require to reimplement a lot of common pieces, Hanami is a convenient and trendy option.
I'll present the reasons that pushed me to pick Hanami to develop a web API, and how to test and develop a web API with it.