Sha256: 0c000dd5946ee67dca69acbe1aa6c132c1d5fe9359906c2957245feed8e7ffa2

Contents?: true

Size: 376 Bytes

Versions: 2

Compression:

Stored size: 376 Bytes

Contents

module RestCore
  class DefaultSite
    def self.members; [:site]; end
    include Middleware

    def call env, &k
      path = if env[REQUEST_PATH].to_s.include?('://')
               env[REQUEST_PATH]
             else
               File.join(site(env).to_s, env[REQUEST_PATH].to_s)
             end

      app.call(env.merge(REQUEST_PATH => path), &k)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rest-core-4.0.1 lib/rest-core/middleware/default_site.rb
rest-core-4.0.0 lib/rest-core/middleware/default_site.rb