Skip to content

Instantly share code, notes, and snippets.

@neall
Created January 21, 2009 17:30
Show Gist options
  • Save neall/50051 to your computer and use it in GitHub Desktop.
Save neall/50051 to your computer and use it in GitHub Desktop.
# 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
require 'app'
run App
#!/bin/sh
thin start -R config.ru
# 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
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