Skip to content
Permalink
Browse files

Setup ActionCable for Heroku

  • Loading branch information...
excid3 committed Apr 8, 2016
1 parent a2be804 commit e53f8ca01d81facc8b8ae67cc4168dceb5664860
Showing with 47 additions and 31 deletions.
  1. +1 −1 .ruby-version
  2. +5 −2 Gemfile
  3. +30 −23 Gemfile.lock
  4. +4 −4 config/database.yml
  5. +5 −1 config/environments/production.rb
  6. +2 −0 config/routes.rb
@@ -1 +1 @@
2.2.2
2.3.0
@@ -1,9 +1,10 @@
source 'https://rubygems.org'
ruby '2.3.0'

gem 'rails', '5.0.0.beta3'
gem 'rails', '~> 5.0.0.beta3'
gem 'sprockets-rails', github: "rails/sprockets-rails"

gem 'sqlite3'
gem 'pg'
gem 'redis'
gem 'puma'

@@ -23,3 +24,5 @@ group :development do
gem 'web-console', github: 'rails/web-console'
gem 'spring'
end

gem 'rails_12factor', '~> 0.0.3'
@@ -8,25 +8,25 @@ GIT

GIT
remote: git://github.com/rails/sprockets-rails.git
revision: 193e80cd1d682ab9f5b9e9c37de69910c7bdd5dd
revision: 4f4b387ea315ba76048079434d53dd44d5a3b0ce
specs:
sprockets-rails (3.0.3)
sprockets-rails (3.0.4)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)

GIT
remote: git://github.com/rails/turbolinks.git
revision: dd31f4b2996f2300631f89339ada82c65b95f4c2
revision: 37a7c296232d20a61bd1946f600da7f2009189db
specs:
turbolinks (3.0.0)
coffee-rails

GIT
remote: git://github.com/rails/web-console.git
revision: 6aa9dd67b8f8dc1111ba6b34bb575b0355ee259b
revision: 0dfeab19861c69eb2ed34c4159452ecc809388c8
specs:
web-console (3.0.0)
web-console (3.1.1)
activemodel (>= 4.2)
debug_inspector
railties (>= 4.2)
@@ -73,7 +73,7 @@ GEM
tzinfo (~> 1.1)
arel (7.0.0)
builder (3.2.2)
byebug (8.2.1)
byebug (8.2.4)
coffee-script (2.4.1)
coffee-script-source
execjs
@@ -85,27 +85,30 @@ GEM
globalid (0.3.6)
activesupport (>= 4.1.0)
i18n (0.7.0)
jbuilder (2.4.0)
jbuilder (2.4.1)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.1.0)
rails-dom-testing (~> 1.0)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (2.99.1)
mime-types (3.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0221)
mini_portile2 (2.0.0)
minitest (5.8.4)
multi_json (1.11.2)
nio4r (1.2.1)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
puma (2.15.3)
pg (0.18.4)
puma (3.4.0)
rack (2.0.0.alpha)
json
rack-test (0.6.3)
@@ -130,34 +133,37 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.5.0)
rake (11.1.2)
redis (3.2.2)
sass (3.4.21)
sass (3.4.22)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
spring (1.6.2)
sprockets (3.5.2)
spring (1.6.4)
sprockets (3.6.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sqlite3 (1.3.11)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.2)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
websocket-driver (0.6.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
@@ -170,13 +176,14 @@ DEPENDENCIES
coffee-rails!
jbuilder (~> 2.0)
jquery-rails
pg
puma
rails (= 5.0.0.beta3)
rails (~> 5.0.0.beta3)
rails_12factor (~> 0.0.3)
redis
sass-rails (~> 5.0)
spring
sprockets-rails!
sqlite3
turbolinks!
uglifier (>= 1.3.0)
web-console!
@@ -1,19 +1,19 @@
default: &default
adapter: sqlite3
adapter:
pool: 105
timeout: 5000

development:
<<: *default
database: db/development.sqlite3
database: actioncable_examples_dev

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
database: actioncable_examples_test

production:
<<: *default
database: db/production.sqlite3
database: actioncable_examples
@@ -76,5 +76,9 @@
config.active_record.dump_schema_after_migration = false

# Set Action Cable server url for consumer connection
# config.action_cable.url = 'ws://cable.example.com:28080'
config.action_cable.url = 'ws://actioncable-gorails.herokuapp.com/cable'

config.action_cable.allowed_request_origins = ['http://actioncable-gorails.herokuapp.com']

This comment has been minimized.

Copy link
@excid3

excid3 Apr 8, 2016

Author Owner

Just make sure you allow the request origin and configure the default action cable URL to point to the route.

end


@@ -1,4 +1,6 @@
Rails.application.routes.draw do
mount ActionCable.server => "/cable"

This comment has been minimized.

Copy link
@excid3

excid3 Apr 8, 2016

Author Owner

This is key because Heroku only allows one port publicly, which you're already using for the webserver.


resource :session
resources :examples

0 comments on commit e53f8ca

Please sign in to comment.
You can’t perform that action at this time.