Skip to content

Instantly share code, notes, and snippets.

@adambeynon
Created February 3, 2014 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adambeynon/8791193 to your computer and use it in GitHub Desktop.
Save adambeynon/8791193 to your computer and use it in GitHub Desktop.
require 'opal'
require 'sinatra'
get '/' do
<<-EOS
<!doctype html>
<html>
<head>
<script src="/assets/application.js"></script>
</head>
</html>
EOS
end
sprockets = Opal::Environment.new
sprockets.append_path 'app'
map '/assets' do
run sprockets
end
source_maps = Opal::SourceMapServer.new(sprockets)
map source_maps.prefix do
run source_maps
end
run Sinatra::Application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment