Simple rack app to serve static content
-
Create a Gemfile
touch Gemfile -
Add the rack gem to the gemfile
source 'https://rubygems.org' gem 'rack' -
Run bundle install
bundle install -
Create a config.ru file with the following code
map "/" do use Rack::Static, urls: [""], root: File.expand_path('./'), index: 'index.html' run lambda {} end -
Create an index.html file
touch index.html -
Run the server and open your browser at 0.0.0.0:9292
bundle exec rackup
Written by Herman Moreno
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rack
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#