Sha256: 7c1bfc9deb559d668ce1b7bd68034b7e1a198069cc6b715203aa9390ceac0ba3

Contents?: true

Size: 696 Bytes

Versions: 36

Compression:

Stored size: 696 Bytes

Contents

# config.ru
require 'bundler'
Bundler.require

Opal::Processor.source_map_enabled = true

opal = Opal::Server.new {|s|
  s.append_path './app'
  s.main = 'example'
  s.debug = true
}

map opal.source_maps.prefix do
  run opal.source_maps
end rescue nil

map '/assets' do
  run opal.sprockets
end

get '/*' do
  example = "show"
  <<-HTML
    <!doctype html>
    <html>
      <head>
        <title>Example: #{example}.rb</title>
        <script src="/assets/#{example}.js"></script>
        <script>#{Opal::Processor.load_asset_code(opal.sprockets, example+".js")}</script>
      </head>
      <body>
        <div id="content"></div>
      </body>
    </html>
  HTML
end

run Sinatra::Application

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
reactrb-0.8.8 example/examples/config.ru
reactrb-0.8.7 example/examples/config.ru
reactrb-0.8.6 example/examples/config.ru
reactrb-0.8.5 example/examples/config.ru
reactrb-0.8.4 example/examples/config.ru
reactrb-0.8.3 example/examples/config.ru
reactrb-0.8.1 example/examples/config.ru
reactrb-0.8.0 example/examples/config.ru
reactrb-0.7.42 example/examples/config.ru
reactive-ruby-0.7.41 example/examples/config.ru
reactive-ruby-0.7.40 example/examples/config.ru
reactive-ruby-0.7.39 example/examples/config.ru
reactive-ruby-0.7.38 example/examples/config.ru
reactive-ruby-0.7.36 example/examples/config.ru
reactive-ruby-0.7.35 example/examples/config.ru
reactive-ruby-0.7.34 example/examples/config.ru
reactive-ruby-0.7.33 example/examples/config.ru
reactive-ruby-0.7.32 example/examples/config.ru
reactive-ruby-0.7.31 example/examples/config.ru
reactive-ruby-0.7.30 example/examples/config.ru