-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathconfig.ru
38 lines (33 loc) · 1.05 KB
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'rack-livereload'
require "./script/setup"
ENVIRONMENT = CONFIG[:environment]
puts "environment: #{ENVIRONMENT}"
use Rack::ConditionalGet
use Rack::ContentLength
Rack::Mime::MIME_TYPES.merge!({
".ttf" => "font/ttf",
".mml" => "application/xml",
".cml" => "application/xml",
".e2d" => "application/xml"
})
# see: https://github.com/johnbintz/rack-livereload
if ENVIRONMENT == 'development'
puts "using rack-live-reload"
map '/vendor/lab-sensor-applet-interface-dist/jars' do
# so no cache headers aren't added to the jars
run Rack::Directory.new PUBLIC_PATH + "/vendor/lab-sensor-applet-interface-dist/jars"
end
map '/vendor/lab-energy2d-java' do
# so no cache headers aren't added to the jars
run Rack::Directory.new PUBLIC_PATH + "/vendor/lab-energy2d-java"
end
map '/' do
use Rack::LiveReload
require "rack-nocache"
use Rack::Nocache
use Rack::Static, :urls => [""], :root => PUBLIC_PATH , :index =>'index.html'
run Rack::Directory.new PUBLIC_PATH
end
else
run Rack::Directory.new PUBLIC_PATH
end