Skip to content

Instantly share code, notes, and snippets.

@erlend
Created May 7, 2014 08:44
Show Gist options
  • Save erlend/3f16cac45dd64be5a36f to your computer and use it in GitHub Desktop.
Save erlend/3f16cac45dd64be5a36f to your computer and use it in GitHub Desktop.
require 'bundler'
Bundler.setup :default
require 'sinatra/base'
require 'sprockets'
require './app'
map '/assets' do
environment = Sprockets::Environment.new
environment.append_path 'assets/javascripts'
environment.append_path 'assets/stylesheets'
environment.append_path 'assets/images'
# Load assets from gems
$:.each do |path|
assets = File.join(path, "..", "vendor", "assets")
["javascripts", "stylesheets", "images"].each do |type|
dir = File.join(assets, type)
environment.append_path dir if File.directory?(dir)
end
end
run environment
end
map '/' do
run Sinatra::Application
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment