Skip to content

Comment on Ruby Patterns from GitHub's Codebaseparent

Comments

Rails 3.0 just does this; given a FooApp Sinatra object, yo can match "/foo" :to => FooApp.

Also doable without rails:

  # In config.ru
  # App, V0, and Resque::Server are each sinatra apps
  run Rack::URLMap.new({
    "/"       => App.new,
    "/v0"     => V0.new,
    "/resque" => Resque::Server.new,
  })
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.