Skip to content

Instantly share code, notes, and snippets.

/rackup.ru Secret

Created September 5, 2014 11:28
Show Gist options
  • Save anonymous/78c565ea7ea93c99cc5b to your computer and use it in GitHub Desktop.
Save anonymous/78c565ea7ea93c99cc5b to your computer and use it in GitHub Desktop.
require 'opal'
require 'sinatra'
apps = []
opal = Opal::Server.new {|s|
s.append_path 'app'
s.main = 'application'
}
map "/__opal_source_maps__" do
run opal.source_maps
end
get '/' do
<<-EOS
<!doctype html>
<html>
<head>
<script src="/assets/application.js"></script>
</head>
</html>
EOS
end
run Rack::Cascade.new([opal, Sinatra::Application])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment