Sha256: af6a4d938980bf372fda95f528484e223b0326bef4c6dd2a29666296854e3eb5

Contents?: true

Size: 380 Bytes

Versions: 21

Compression:

Stored size: 380 Bytes

Contents

require 'assette/server'

module Assette
  class Middleware
    def initialize(app, *args)
      @app = app
    end
    
    def call(env)
      if env['PATH_INFO'] == '/'
        return @app.call(env)
      end
      
      assette_resp = Assette::Server.call(env)
      if assette_resp[0] == 200
        assette_resp
      else
        @app.call(env)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
assette-0.1.8 lib/assette/middleware.rb
assette-0.1.7 lib/assette/middleware.rb
assette-0.1.6 lib/assette/middleware.rb
assette-0.1.5 lib/assette/middleware.rb
assette-0.1.4 lib/assette/middleware.rb
assette-0.1.3 lib/assette/middleware.rb
assette-0.1.2 lib/assette/middleware.rb
assette-0.1.1 lib/assette/middleware.rb
assette-0.1.0 lib/assette/middleware.rb
assette-0.0.13 lib/assette/middleware.rb
assette-0.0.12 lib/assette/middleware.rb
assette-0.0.11 lib/assette/middleware.rb
assette-0.0.10 lib/assette/middleware.rb
assette-0.0.9 lib/assette/middleware.rb
assette-0.0.8 lib/assette/middleware.rb
assette-0.0.7 lib/assette/middleware.rb
assette-0.0.6 lib/assette/middleware.rb
assette-0.0.5 lib/assette/middleware.rb
assette-0.0.4 lib/assette/middleware.rb
assette-0.0.3 lib/assette/middleware.rb