-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrack.rb
More file actions
21 lines (17 loc) · 739 Bytes
/
Copy pathrack.rb
File metadata and controls
21 lines (17 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$: << File.join(File.dirname(__FILE__))
# use PathPrefix Middleware if :path_prefix is set in Merb::Config
if prefix = ::Merb::Config[:path_prefix]
use Merb::Rack::PathPrefix, prefix
end
# comment this out if you are running merb behind a load balancer
# that serves static files
use Merb::Rack::Static, Merb.dir_for(:public)
Merb::Slices.config.each do |slice_module, config|
slice_module = Object.full_const_get(slice_module.to_s.camel_case) if slice_module.class.in?(String, Symbol)
slice_module.send("public_components").each do |component|
slice_static_dir = slice_module.send("dir_for", :public)
use Merb::Rack::Static, slice_static_dir
end
end
# this is our main merb application
run Merb::Rack::Application.new