Skip to content

Instantly share code, notes, and snippets.

@ebryn
Created January 15, 2012 08:08
Show Gist options
  • Save ebryn/1615017 to your computer and use it in GitHub Desktop.
Save ebryn/1615017 to your computer and use it in GitHub Desktop.
input "app"
output "public"
require 'rake-pipeline'
require 'rake-pipeline/middleware'
require "rack/streaming_proxy" # Don't forget to install the rack-streaming-proxy gem.
use Rack::StreamingProxy do |request|
# Insert your own logic here
if request.path.start_with?("/api")
"http://localhost#{request.path.sub("/api", "")}"
end
end
use Rake::Pipeline::Middleware, 'Assetfile' # This is the path to your Assetfile
run Rack::Directory.new('public') # This should match whatever your Assetfile's output directory is
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment