Skip to content

Instantly share code, notes, and snippets.

@tetz-akaneya
Created January 13, 2019 01:54
Show Gist options
  • Select an option

  • Save tetz-akaneya/5595ac47c58163eb779e5ed8b55dff18 to your computer and use it in GitHub Desktop.

Select an option

Save tetz-akaneya/5595ac47c58163eb779e5ed8b55dff18 to your computer and use it in GitHub Desktop.
Railsにおいて、--apiをつけてnewした際には、通常のnewした際に比べてmiddlewareは以下のように異なる
(コメントアウトしている部分がapiモードの際にはかけている部分。)
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::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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment