Created
April 11, 2014 04:59
-
-
Save amitittyerah/10441608 to your computer and use it in GitHub Desktop.
Simple webserver with Rack
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
$ sudo apt-get install ruby-bundler | |
# Gemfile | |
source :rubygems | |
gem 'rack' | |
$ bundler install | |
# config.ru | |
use Rack::Static, | |
:urls => ["/assets"], | |
:root => "public" | |
run lamda { |env| | |
[ | |
200, | |
{ | |
'Content-Type' => 'text/html', | |
'Cache-Control' => 'public, max-age=3600' | |
}, | |
File.open('public/index.html', File::RDONLY) | |
] | |
} | |
$ rackup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment