lib/apipie/static_dispatcher.rb
# Dispatches the static files. Similar to ActionDispatch::Static, but
# it supports different baseurl configurations
Dispatches the static files. Similar to ActionDispatch::Static, but
it supports different baseurl configurations
Dispatches the static files . Similar to ActionDispatch :: Static but it supports different baseurl configurations
def call(env)
      @baseurl ||= Apipie.configuration.doc_base_url
      case env['REQUEST_METHOD']
      when 'GET', 'HEAD'
        path = env['PATH_INFO'].sub("#{@baseurl}/","/apipie/").chomp('/')
        if match = @file_handler.match?(path)
          env["PATH_INFO"] = match
          return @file_handler.call(env)
        end
      end
      @app.call(env)
    end
def call ( env ) @baseurl ||= Apipie . configuration . doc_base_url case env [ 'REQUEST_METHOD' ] when 'GET' , 'HEAD' path = env [ 'PATH_INFO' ] . sub ( "#{@baseurl}/" , "/apipie/" ) . chomp ( '/' ) if match = @file_handler . match? ( path ) env [ "PATH_INFO" ] = match return @file_handler . call ( env ) end end @app . call ( env ) end
Dispatches the static files.
Dispatches the static files .
env
<not_specific>