I was wondering which could be a better way of mounting different apps for ruby . I have 2 sinatra apps and one rails app .
One way is to use rails as base and mount the sinatra apps using the routes.rb
(within rails)
RailsApp::Application.routes.draw do
mount SinatraApp1, :at => "/url1"
mount SinatraApp2, :at => "/url2"
# rest of the rail routes
end
This way both the sinatra apps are in rails.
Other way is to use rackup to mount all three using config.ru
(all three apps in parallel)
map "/" do
run RailsApp::Application
end
map "/url1" do
run SinatraApp1
end
map "/url2" do
run SinatraApp2
end
I am not able to find the advantages of one over the other or which method is better for what reason.