Skip to content

Instantly share code, notes, and snippets.

@ch4nd4n
Last active March 28, 2022 13:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ch4nd4n/4618134 to your computer and use it in GitHub Desktop.
Save ch4nd4n/4618134 to your computer and use it in GitHub Desktop.
Multiple Modular Sinatra App
#admin/admin.rb
class AdminApp < Sinatra::Base
get "/" do
haml :index
end
end
require 'sinatra'
require 'haml'
class MyApp < Sinatra::Base
get "/" do
haml :index
end
end
-# views/index.haml
%h3 App Index File
require './app'
require './admin/admin'
run Rack::URLMap.new("/" => MyApp.new, "/admin" => AdminApp.new)
-# admin/views/index.haml
%h3 Admin Index file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment