Hi, in [1] you can find some pretty generic code that I use (with search and replace for RestXQ paths) in many of my projects to serve anything in some directory related to website served using BaseX. Another example of that code would be [2].
Best regards Omar
[1] https://github.com/acdh-oeaw/openapi4restxq/blob/master_basex/swagger-ui.xqm... [2] https://github.com/acdh-oeaw/vicav-app/blob/master/http.xqm#L9-L158