BaseX Server
✓ Published0🌍 Public
CCliffordAnderson
Last edited May 8, 2015
Created on May 8, 2015
This example shows a minimal RESTful web application built with BaseX, a native XML database, that serves XHTML pages for a poetry corpus. The code defines four GET endpoints—root, `/about`, `/credits`, and `/poem/{name}`—each returning a simple HTML page via the `view:display-contents` function. The implementation uses BaseX’s RESTXQ annotations (`%rest:path`, `%rest:GET`) and XQuery modules (`api.xqm`, `model.xqm`, `view.xqm`). The `model:credits` function supplies static HTML content, while the view module constructs the page skeleton. Data is hardcoded in XQuery, with no external datasets or JavaScript libraries involved.
AI-generated description