Created
January 21, 2009 17:30
-
-
Save neall/50051 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# To enable files to be served from "./public/", the :static | |
# and :app_file options have to be set. | |
require 'rubygems' | |
require 'sinatra/base' | |
class App < Sinatra::Base | |
set :static, true | |
set :app_file, __FILE__ | |
get '/' do | |
'See <a href="/thing.txt">this text file</a>.' | |
end | |
end |
This file contains hidden or 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' | |
run App |
This file contains hidden or 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
#!/bin/sh | |
thin start -R config.ru |
This file contains hidden or 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 standalone version can serve the text file just fine | |
require 'rubygems' | |
require 'sinatra' | |
get '/' do | |
'See <a href="/thing.txt">this text file</a>.' | |
end |
This file contains hidden or 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
How do I get this file served automatically? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment