Sha256: 5ca8eb7af3d160790aae61397e1fb7ce0bd1df6159b9e8cff7c1506d1a9e265e

Contents?: true

Size: 578 Bytes

Versions: 1

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

lib = File.expand_path("../../../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require './app'
require './chat'

LiteCable.config.log_level = Logger::DEBUG

app = Rack::Builder.new do
  map '/' do
    run App
  end
end

if ENV['ANYCABLE']
  # Turn AnyCable compatibility mode
  LiteCable.anycable!
else
  require "lite_cable/server"

  app.map '/cable' do
    use LiteCable::Server::Middleware, connection_class: Chat::Connection
    run proc { |_| [200, { 'Content-Type' => 'text/plain' }, ['OK']] }
  end
end

run app

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
litecable-0.5.0 examples/sinatra/config.ru