/sinatra.rb Secret
Created
September 5, 2014 12:49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'opal' | |
require 'sinatra' | |
opal = Opal::Server.new {|s| | |
s.append_path 'app' | |
s.main = 'application' | |
} | |
map '/__opal_source_maps__' do | |
run opal.source_maps | |
end | |
map '/assets' do | |
run opal.sprockets | |
end | |
get '/' do | |
<<-EOS | |
<!doctype html> | |
<html> | |
<head> | |
<script src="/assets/application.js"></script> | |
</head> | |
</html> | |
EOS | |
end | |
run Sinatra::Application |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment