Skip to content

Commit

Permalink
url rewriter for rest app is overridable and uses .xml by default for…
Browse files Browse the repository at this point in the history
… ml8
  • Loading branch information
Ryan Semerau committed Jun 1, 2015
1 parent 16e8262 commit fedf8ca
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2106,6 +2106,15 @@ def build_config(config_file)
rest_auth_method = conditional_prop('ml.rest-authentication-method', 'ml.authentication-method')
rest_default_user = conditional_prop('ml.rest-default-user', 'ml.default-user')

rest_url_rewriter = nil
if @properties['ml.rest-url-rewriter'].present?
rest_url_rewriter = @properties['ml.rest-url-rewriter']
elsif @server_version > 7
rest_url_rewriter = '/MarkLogic/rest-api/rewriter.xml'
else
rest_url_rewriter = '/MarkLogic/rest-api/rewriter.xqy'
end

config.gsub!("@ml.rest-appserver",
%Q{
<http-server import="@ml.app-name">
Expand All @@ -2115,7 +2124,7 @@ def build_config(config_file)
<modules name="@ml.app-name-rest-modules"/>
<authentication>#{rest_auth_method}</authentication>
<default-user name="#{test_default_user}"/>
<url-rewriter>/MarkLogic/rest-api/rewriter.xqy</url-rewriter>
<url-rewriter>#{rest_url_rewriter}</url-rewriter>
<error-handler>/MarkLogic/rest-api/error-handler.xqy</error-handler>
<rewrite-resolves-globally>true</rewrite-resolves-globally>
</http-server>
Expand Down

0 comments on commit fedf8ca

Please sign in to comment.