ratalada
A DSL for running Rack servers as easily as you can in JavaScript — pattern-match your routes, pick a backend with a require, and run.
In Node you can stand up a server in three lines. In Ruby the same thing usually means a framework, a config file, and a rackup invocation. Ratalada closes that gap:
require "ratalada/puma"
Server.run do |request|
case request
in ["GET", "/"] then "hello\n"
end
end
That’s a whole app. Run the file, and it’s listening on http://127.0.0.1:9292.
How it fits together
Ratalada is two small, swappable pieces:
- Backends run the Rack app.
require "ratalada/puma"orrequire "ratalada/falcon"picks the server and defines the top-levelServerconstant. - Frontends turn your
Server.runblock into a Rack app. The default is a pattern-matching router;require "ratalada/sinatra"orrequire "ratalada/grape"swaps in Sinatra’s or Grape’s DSL on whichever backend you chose.
The core gem has no runtime dependencies of its own — install whichever server you actually run on. The Sinatra and Grape adapters are separate gems (ratalada-sinatra, ratalada-grape), but you install the gem and still require "ratalada/sinatra" — see require semantics.
What’s here
- Start Here — install ratalada and run your first server.
- Guides — the router DSL and its handler forms, backends and configuration, how frontends are packaged, and the Sinatra and Grape frontends.
- Examples — complete runnable servers straight from the repo.