Created
May 25, 2012 17:51
-
-
Save bmarini/2789471 to your computer and use it in GitHub Desktop.
Goliath app to serve static files
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 'goliath' | |
# require 'goliath/rack/templates' | |
# require 'haml' | |
# $:.unshift File.expand_path('../lib', __FILE__) | |
class StaticAndTemplateFiles < Goliath::API | |
# include Goliath::Rack::Templates | |
use( Rack::Static, | |
:root => Goliath::Application.app_path('public'), | |
:urls => ['/'], | |
:cache_control => 'public, max-age=3600' | |
) | |
def response(env) | |
[ 200, {"Content-Type" => "text/html"}, [""] ] | |
end | |
end | |
class App < Goliath::API | |
map '/', StaticAndTemplateFiles | |
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
web: bundle exec ruby app.rb -sv -e prod -p $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment