forked from Katello/katello
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ru
29 lines (22 loc) · 1.01 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
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
# apply a prefix to the application, if one is defined
# e.g. http://some.server.com/prefix where '/prefix' is defined by env variable
if Katello.config.embed_yard_documentation
prefixed_router = Class.new YARD::Server::Router do
prefix = Katello.early_config.url_prefix + '/yard/'
methods = { :docs_prefix => 'docs', :list_prefix => 'list', :search_prefix => 'search' }
methods.each do |method, suffix|
define_method(method) { prefix[1..-1] + suffix }
end
end
libraries = { 'katello' => [YARD::Server::LibraryVersion.new('katello', nil, "#{Rails.root}/.yardoc")] }
use YARD::Server::RackMiddleware,
:libraries => libraries,
:options => { :router => prefixed_router, :incremental => true, :single_library => true },
:server_options => { }
YARD::Logger.instance.level = 0
end
map Katello.config.url_prefix do
run Src::Application
end