The .basex file configures **where on disk** the RestXQ-Servlet looks für XQuery modules:
In your case: PROJECT_ROOT/webapp
* RESTXQPATH
If this a relative path, it will be relative to your WEBPATH — so setting it to „modules“ will resolve to:
PROJECT_ROOT/webapp/modules
Now this summarizes it for your on disk-context ;-)
Switchting to the Servlet-context, you must make sure to tell the Container where to server your RESTXQ-Servlet:
This can be seen in Web.xml here:
So basically you need to tell jetty, or whatever container you have, what’s the ROOT-Url for the RESTXQ contents.
So in my web.xml anything *under* /api/ will be sent to the RESTXQ-Servlet which in turn tries to make sense of the URL and resolve it against your XQuery annotations :-)
Hope this helps
Michael
Thanks Michael,
I cloned your repo and borrowed your .basex file. It did indeed allow me to specify the page location. However, I'm not able to get it to find my RESTXQ is my services. I added the out of the box BaseX ./bin to my PATH and changed to a completely different directory. Attached is my .basex and database-services.xqm file. For debugging purposes, I wanted to make sure my services point to the right database. My setup is like this:
PROJECT_ROOT/.basex
PROJECT_ROOT/.basexhome
PROJECT_ROOT/modules/database
PROJECT_ROOT/webapp/modules/database-services.xqm
PROJECT_ROOT/modules/database-services.xqm
I duplicated the database-services file because I wasn't sure what folder the RESTXQ was relative to.
Vielen Danke!