Last active
August 29, 2015 14:06
-
-
Save sabcio/6a323a6ba2e17d3c74c0 to your computer and use it in GitHub Desktop.
Simple Rack application to server static content
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
use Rack::Static, | |
:urls => ["/images", "/js", "/css"], | |
:root => "public" | |
run lambda { |env| | |
[ | |
200, | |
{ | |
'Content-Type' => 'text/html', | |
'Cache-Control' => 'public, max-age=86400' | |
}, | |
File.open('public/index.html', File::RDONLY) | |
] | |
} |
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
- application-name | |
|- config.ru | |
|- Gemfile | |
|- Rakefile | |
|- public | |
|- index.html | |
|- images | |
|- js | |
|- css |
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
source :rubygems | |
gem 'rack' | |
gem 'rake' | |
gem 'thin', group: :production |
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
namespace :db do | |
task :migrate | |
task :setup | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment