Chapter 7 The Final Act
We’ve finished building our application now; it does everything it needs to do, so no more functionality will be added. This chapter is all about making our app more maintainable by switching to a modular structure. We’ll look at how to create a modular-style application in Sinatra and discuss the benefits of doing so. I will demonstrate this by separating the website and song files into separate modules, and use Rack to route the URLs to the correct module.
We’ll cover how easy it is to use Sinatra to create Rack middleware applications that can be used in other Sinatra applications, as well as other Rack-based frameworks such as Ruby on Rails. To demonstrate this, we’ll create our own asset handler middleware ...
Get Jump Start Sinatra now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.