Sha256: e49c4005947a0bdff6cf5a5d2ba95aed40084c880ef0f2e3d9f968e7b1918370
Contents?: true
Size: 845 Bytes
Versions: 1
Compression:
Stored size: 845 Bytes
Contents
module Ki class KiApp # should never reach this # middleware should catch all the requests def call env s = 'misplaced in space' Rack::Response.new(s).finish end end class Ki PUBLIC_PATH = 'public' VIEWS_PATH = 'views' def initialize KiConfig.instance.read environment Orm::Db.instance.establish_connection @app = Rack::Builder.new do use Middleware::InitMiddleware # TODO what happens with invalid json? use Rack::Parser, :content_types => { 'application/json' => Proc.new { |body| ::MultiJson.decode body } } KiConfig.instance.middleware.each do |middleware| use middleware end run KiApp.new end end def environment ENV['RACK_ENV'] end def call env @app.call env end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ki-0.4.5 | lib/ki/ki.rb |