You see the use statement in your config.ru, that is telling the Merb::Rack::Static middleware (just a rack app).
Look at this documentation and you will see a great example of how to use map and use to put a middleware (which can be a Sinatra::Base app, not the normal one) in a subdirectory: http://rack.rubyforge.org/doc/Rack/Builder.html So an example might be a Blog class that inherits from Sinatra::Base. map "/blog" { use Blog } Give it a try and see if it works. On Aug 18, 3:28 pm, supaspoida <[email protected]> wrote: > Thanks guys, I suspected this was possible but still not clear on the > specifics. > > I should have also mentioned that I'm running this on Heroku, so I > can't just use the Apache/Passenger options to run sinatra at a > different url. > > Here is my config.ru file, any advice on how to include sinatra as > part of this? > > require 'merb-core' > Merb::Config.setup(:merb_root => ".", :environment => ENV['RACK_ENV']) > Merb.environment = Merb::Config[:environment] > Merb.root = Merb::Config[:merb_root] > Merb::BootLoader.run > > use Merb::Rack::Static, Merb.dir_for(:public) > run Merb::Rack::Application.new > > require 'rubygems' > DataMapper.setup(:default, ENV['DATABASE_URL'] || 'sqlite3://my.db') > > On Aug 16, 12:29 am, myobie <[email protected]> wrote: > > > > > On Aug 15, 1:28 pm, supaspoida <[email protected]> wrote: > > > > Is this possible with rack? Can anybody point me to a blog or some > > > open source code with an example? > > > In config.ru, you can map sinatra to /blog and then just use your meb > > app how it is now. Effectively just using sinatra as a middleware. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/merb?hl=en -~----------~----~----~----~------~----~------~--~---
