Sha256: be51340fcd563f62bf11ecafda8514f8f80a4074dfcf5659cf696d796f623416

Contents?: true

Size: 533 Bytes

Versions: 1

Compression:

Stored size: 533 Bytes

Contents

require 'bundler'
Bundler.require

html = <<-HTML
  <!DOCTYPE html>
  <html>
  <head>
    <title>opal-jquery specs</title>
  </head>
    <body>
      <script src="/assets/autorun.js"></script>
    </body>
  </html>
HTML

map '/assets' do
  env = Opal::Environment.new
  env.append_path 'vendor' # for jquery
  env.append_path 'spec'
  run env
end

map '/' do
  run lambda { |env|
    if env['PATH_INFO'] == '/'
      [200, {'Content-Type' => 'text/html'}, [html]]
    else
      Rack::Directory.new('spec').call(env)
    end
  }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-jquery-0.0.5 config.ru