提交 707144a3 编写于 作者: R Robin Dupret

Remove the paragraph about Rails::Server#middleware

As of 56903585, the Rack::ContentLength middleware isn't included by
default anymore.

The only remaining middleware is Rack::Lock ; since it's only included
when using WEBrick, it's certainly not worth documenting it in the
guides.

[ci skip]
上级 de0a2a49
......@@ -58,22 +58,6 @@ class Server < ::Rack::Server
end
```
Here's how it loads the middlewares:
```ruby
def middleware
middlewares = []
middlewares << [::Rack::ContentLength]
Hash.new(middlewares)
end
```
The following table explains the usage of the loaded middlewares:
| Middleware | Purpose |
| ----------------------- | --------------------------------------------------------------------------------- |
| `Rack::ContentLength` | Counts the number of bytes in the response and set the HTTP Content-Length header |
### `rackup`
To use `rackup` instead of Rails' `rails server`, you can put the following inside `config.ru` of your Rails application's root directory:
......@@ -81,8 +65,6 @@ To use `rackup` instead of Rails' `rails server`, you can put the following insi
```ruby
# Rails.root/config.ru
require ::File.expand_path('../config/environment', __FILE__)
use Rack::ContentLength
run Rails.application
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册