Reputation: 23767
What advantages do I have with a Rack app over a sinatra app?
thanks
Upvotes: 3
Views: 2956
Reputation: 175
I think the asker wants the merits of keeping it to just Rack.
Considering Sinatra is already an extremely thin & minimalistic veneer for typical web applications, my short answer will be: when your needs are atypical and/or spartan
when you don't even need...
I use Sinatra because I believe this is the lowest footprint you can really focus on business function of my apps, without dealing with web server nitty-gritties (Rails conversely is monoli-thick!) and still have an intuitive MVC-like project structure
You gain really little except code lines, and a smarmy twinkle in your eye when impressing geeks honest.
p.s.: I maintain a nice skeleton for my own needs at http://github.com/codepants/yasumi
Upvotes: 8
Reputation: 4084
Rack, a modular Ruby webserver interface Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call.
Rack is a bare-bones middleware and therefore a bit more lightweight but doesn't help you that much when building complex applications.
Sinatra is a Domain Specific Language (DSL) for quickly creating web-applications in Ruby.
It keeps a minimal feature set, leaving the developer to use the tools that best suit them and their application.
Sinatra is a small "framework" on top of Rack providing you with nifty methods to get up running quickly. It's not that lightweight as Rack but still as light as a cloud in the sky.
Upvotes: 3