(:~ : Common RESTXQ access points. : : @author Eliúd Santiago Meza y Rivera, BaseX Team 2005-20, BSD License :) xquery version "3.1"; module namespace app = 'app/PiTower'; (: import module namespace G = 'CMCCMM/cons' at 'modules/cons.xqm'; :) (: import module namespace tmpltxq = 'CMCCMM/tmplt' at 'modules/tmpltxq.xqm'; :) (: import module namespace HTML = 'CMCCMM/html' at 'modules/html.xqm'; :) import module namespace html = 'app/html' at '../modules/html.xqm'; (:~ : Redirects to the start page. : @return redirection :) declare %rest:path('/app/PiTower') function app:redirect( ) as element(rest:response) { web:redirect('/app/PiTower/resumen') }; (:~ : Returns a file. : @param $file file or unknown path : @return rest binary data :) declare %rest:path('/app/PiTower/static/{$file=.+}') %output:method('basex') %perm:allow('public') function app:file( $file as xs:string ) as item()+ { let $path := file:base-dir() || 'static/' || $file return ( web:response-header( map { 'media-type': web:content-type($path) }, map { 'Cache-Control': 'max-age=0,public', 'Content-Length': file:size($path) } ), file:read-binary($path) ) }; (:~ : Shows a 'page not found' error. : @param $path path to unknown page : @return page :) declare %rest:path('/app/PiTower/{$path=.+}') %output:method('html') function app:unknown( $path as xs:string ) as element(html) { html:wrap-main('PiTower',

404

¡Oops! Página no encontrada.

No pudimos encontrar la página que estabas buscando Mientras tanto, puedes regresar Sitio o puedes utilizar la búsqueda.

) }; declare %rest:path('/app/PiTower/resumen') %output:method('html') %output:html-version('5.0') function app:resumen () as element(html)+ { html:wrap-main('PiTower', element div { element div {"Aquí debería ir el resumen del APK PiTower Corporation"}, element div {request:path()}, element ul { fn:tokenize(substring(request:path(),6,string-length(request:path())),'/') !
  • {.}
  • } } ) }; (: element div {"Aquí debería ir el resumen de las aplicaciones disponbiles"}, element ul { db:open-pre("app-config",0)/apps/app/@id/data() ! element li {.} } :)