提交 a381add0 编写于 作者: K Kasper Timm Hansen

[ci skip] Steal `ActionCable.server` mounting from routes template.

Mounting it as prescribed here:

https://github.com/rails/rails/blob/0d1d50c2db40ea1a9d3bebfb0c35da43bbd4d27f/railties/lib/rails/generators/rails/app/templates/config/routes.rb#L5
上级 0d1d50c2
......@@ -399,12 +399,12 @@ The above will start a cable server on port 28080. Remember to point your client
### In app
If you are using a threaded server like Puma or Thin, the current implementation of ActionCable can run side-along with your Rails application. For example, to listen for WebSocket requests on `/cable`, match requests on that path:
If you are using a threaded server like Puma or Thin, the current implementation of ActionCable can run side-along with your Rails application. For example, to listen for WebSocket requests on `/cable`, mount the server at that path:
```ruby
# config/routes.rb
Example::Application.routes.draw do
match "/cable", :to => ActionCable.server, via: [:get, :post]
mount ActionCable.server => '/cable'
end
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册