Adjustments for subdirectory serving (9)
diff --git a/dev/js/src/api.js b/dev/js/src/api.js
index 00821de..d6493cb 100644
--- a/dev/js/src/api.js
+++ b/dev/js/src/api.js
@@ -6,7 +6,7 @@
// http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml
// http://stackoverflow.com/questions/6112744/load-javascript-on-demand
- KorAP.URL = KorAP.URL || 'http://korap.ids-mannheim.de/kalamar';
+ KorAP.URL = KorAP.URL !== undefined ? KorAP.URL : 'http://korap.ids-mannheim.de/kalamar';
KorAP.API = KorAP.API || {};
diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep
index aea4cfa..a729e42 100644
--- a/templates/layouts/main.html.ep
+++ b/templates/layouts/main.html.ep
@@ -37,7 +37,7 @@
<script src="<%= (stash('prefix') // '') . '/js/' . loc('jsFile', 'kalamar-' . $Kalamar::VERSION . '-en.js') %>"></script>
%= javascript begin
window.KorAP = window.KorAP || {};
- % my $api = url_for('index')->to_abs;
+ % my $api = url_for('index');
% $api =~ s!/$!!;
KorAP.URL = '<%== $api %>';
% end