Commit 401c3ff1 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

/ and /index.html as default route

parent d28a20f7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import module namespace errors = 'https://certic.unicaen.fr/max/errors';
import module namespace i18n = 'https://certic.unicaen.fr/max/i18n';
import module namespace utils = 'https://certic.unicaen.fr/max/utils';


(:~
 : @return default html index page
 :)
@@ -20,11 +21,12 @@ declare
%output:method("html")
%output:html-version("5.0")
%output:encoding("UTF-8")
%rest:path("/index.html")
function routes:default-index(){
%rest:path("/{$path=(index.html)?")
function routes:index($path as xs:string?){
    web:redirect('/' || $conf:default-lang || '/pages/index.html')
};


(:~
 : @param $lang language
 : @param $collection collection