Skip to main content
100%

Sample RestXQ

✓ Published0🌍 Public
CCliffordAnderson
Last edited Feb 23, 2018
Created on Feb 23, 2018

This example demonstrates how to route HTTP requests and return XML responses using the RESTXQ API in BaseX. It defines multiple endpoint paths, including dynamic segments like `hello/{$who}` and `post/{$post}`, alongside static routes for the root and about pages. A custom error handler returns a 404 status with an HTML page when a requested path does not match any defined route. The code imports a separate model module that provides a `say-hello` function, which is called by the hello endpoint to generate XML output.

AI-generated description

Similar vizzes