我使用了这个宝石https://github.com/websocket-rails/websocket-rails。和 我尝试通过curls在websocket-rails app中创建新用户。例如:
curl http://localhost:3000/websocket -d 'message={"channel":"/new_user", "user_name":"user1"}'
http://localhost:3000/websocket_rails
http://localhost:3000/faye
http://localhost:3000/
但我总是收到错误:
ActionController::RoutingError (No route matches [POST] "/websocket_rails"):
ActionController::RoutingError (No route matches [POST] "/websocket"):
等...
rake routes:
Prefix Verb URI Pattern Controller#Action
public_index GET /public/index(.:format) public#index
root GET / public#index
websocket GET /websocket(.:format) websocket_rails
routes.rb
Ws42::Application.routes.draw do
get "public/index"
root to: "public#index"
end
我必须在http://localhost:3000/
之后写下哪个地址?