"rails middleware"
E:\dev\rails\sqlite-demo>rails middleware
use Webpacker::DevServerProxy
use ActionDispatch::HostAuthorization
use Rack::Sendfile
use ActionDispatch::Static
use ActionDispatch::Executor
use ActiveSupport::Cache::Strategy::LocalCache::Middleware
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use ActionDispatch::RemoteIp
use Sprockets::Rails::QuietAssets
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use WebConsole::Middleware
use ActionDispatch::DebugExceptions
use ActionDispatch::ActionableExceptions
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::Migration::CheckPending
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ContentSecurityPolicy::Middleware
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use Rack::TempfileReaper
run SqliteDemo::Application.routes
rack
require 'rack'
class HelloRack
def call(env)
[200, { 'Content-Type' => 'text/html'},['Hello Rack']
end
end
run HelloRack.new
# This is used by Rack-based servers to start the application
require ::File.expand_path('../config/environment', __FILE__)
run Rails.Application
Rails.application.routes.draw demo
match "/hello", to:
lambda { |env| [200, { "Content-Type" => "text/plain"}, ["World"]}
end