Last active
August 29, 2015 14:15
-
-
Save DouglasAllen/5174e8058930a770e583 to your computer and use it in GitHub Desktop.
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
# This file is used by Rack-based servers to start the application. | |
require ::File.expand_path('../config/environment', __FILE__) | |
#run DemoApp::Application | |
app = Rack::Builder.new do | |
use Rack::Reloader | |
map '/' do | |
# This is the root of our app | |
@root = File.expand_path(File.dirname(__FILE__)) | |
run lambda {|env| Rack::Directory.new(@root).call(env)} | |
end | |
class Site | |
def self.call(env) | |
[200, { "Content-Type" => "text/html" }, ["#{env}"]] | |
end | |
end | |
map '/lost' do | |
run Site | |
end | |
end.to_app | |
run app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment