Sha256: 95e2c5d87939b373ad296753cb83a35bb490c1a829996fe8aa64b11c9f7129d0

Contents?: true

Size: 378 Bytes

Versions: 3

Compression:

Stored size: 378 Bytes

Contents

module Bonsai
  class StaticPassThrough < Rack::Static
    def call(env)
      result = super
      return result unless result[0] == 404 || result[0] == "404"
      @app.call(env)
    end
  end
  
  class DevelopmentServer < Sinatra::Base
    get '/' do
      Page.find("index").render
    end
    
    get '/*' do
      Page.find(params[:splat].to_s).render
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bonsai-1.1.0 lib/bonsai/webserver.rb
bonsai-1.0.1 lib/bonsai/webserver.rb
bonsai-1.0.0 lib/bonsai/webserver.rb