Files for Google Cloud Run
✓ Published0🌍 Public
CCliffordAnderson
Last edited Jul 1, 2019
Created on Jul 1, 2019
This example demonstrates a minimal HTTP service that returns the current time and date in JSON format, along with milliseconds since the Unix epoch. It uses BaseX’s RESTXQ module, specifically the `%rest:path` and `%output:method` annotations, to expose an XQuery function at the root path. The function formats the current time with `fn:format-time`, calculates epoch milliseconds by subtracting `xs:dateTime("1970-01-01T00:00:00-00:00")` from the current dateTime, and returns a JSON map. The included Dockerfile builds a container from `basex/basexhttp:latest`, copying the XQuery file into the webapp directory and launching BaseX HTTP on port 8080.
AI-generated description