You can serve static files with Sinatra by placing them in public/
(by default) -- I have an index.html
in there at the moment, but how can I make the
Just set enable :static
inside of your app class. Like so:
class App < Sinatra::Base
# Set the app root; this is where the 'public' and 'views'
# directories are found (by default).
set :root, File.expand_path("#{File.dirname(__FILE__)}/../app")
# Allow the app to serve static files from the 'public' directory in :root
enable :static
end