Commit 88859717 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

suppression fonction doublon (error404)

parent 148f9b52
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -8,15 +8,6 @@ import module namespace max.toc = 'pddn/max/toc' at 'rxq/toc.xqm';
import module namespace max.api = 'pddn/max/max_api' at 'rxq/max_api.xqm';
import module namespace request = "http://exquery.org/ns/request";

declare %output:method("text") %rest:path("") function max:error404() {
    <rest:response>
        <http:response status="404">
            <http:header name="Content-Language" value="en"/>
            <http:header name="Content-Type" value="text/plain; charset=utf-8"/>
        </http:response>
    </rest:response>,
    "The requested resource is not available."
};

(:MaX Home:)
declare
@@ -28,7 +19,7 @@ declare
function max:home(){
    let $jsonFile := file:parent(static-base-uri()) ||'package.json'
    return if(not(file:exists($jsonFile)))
        then max:error404() (:no max.html in production env.:)
        then max.util:error404() (:no max.html in production env.:)
    else
        let $json := file:read-text($jsonFile)
        let $version := json:parse($json)//version