Method: Opal::SimpleServer#call

Defined in:
lib/opal/simple_server.rb

#call(env) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/opal/simple_server.rb', line 39

def call(env)
  case env['PATH_INFO']
  when %r{\A/#{@prefix}/(.*)\.m?js\z}
    path, _cache_invalidator = Regexp.last_match(1).split('?', 2)
    call_js(path)
  else call_index
  end
rescue NotFound => error
  [404, {}, [error.to_s]]
end