Last active
March 28, 2022 13:57
-
-
Save ch4nd4n/4618134 to your computer and use it in GitHub Desktop.
Multiple Modular Sinatra App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#admin/admin.rb | |
class AdminApp < Sinatra::Base | |
get "/" do | |
haml :index | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'haml' | |
class MyApp < Sinatra::Base | |
get "/" do | |
haml :index | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# views/index.haml | |
%h3 App Index File |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './app' | |
require './admin/admin' | |
run Rack::URLMap.new("/" => MyApp.new, "/admin" => AdminApp.new) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# 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