Skip to content

Commit 3b7a66d

Browse files
committedSep 5, 2014
Add sourcemaps support to sinatra example
1 parent eb5905b commit 3b7a66d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed
 

‎examples/sinatra/config.ru

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
require 'opal'
22
require 'sinatra'
33

4+
opal = Opal::Server.new {|s|
5+
s.append_path 'app'
6+
s.main = 'application'
7+
}
8+
9+
map '/__opal_source_maps__' do
10+
run opal.source_maps
11+
end
12+
13+
map '/assets' do
14+
run opal.sprockets
15+
end
16+
417
get '/' do
518
<<-EOS
619
<!doctype html>
@@ -12,10 +25,4 @@ get '/' do
1225
EOS
1326
end
1427

15-
map '/assets' do
16-
env = Opal::Environment.new
17-
env.append_path 'app'
18-
run env
19-
end
20-
2128
run Sinatra::Application

0 commit comments

Comments
 (0)
Please sign in to comment.