A MarkLogic rewrite Sample Application: CouchDB Facade
JavaScript XQuery
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



facade is a rewrite sample application. It exposes MarkLogic Server by implementing a small subset of the CouchDB HTTP API. The objective of facade is to demonstrate how to use rewrite to create a JSON backed web-service. Simple decisions were made in implementing the service and it should not be regarded as an real MVC implementation. In fact the code needs serious refactoring.

In the future facade could be used as a compatibility layer between MarkLogic Server and CouchDB, leveraging drivers and replication amongst each other. At this point that is not the objective of the project.

facade includes futon which is part of CouchDB. A small fix to support multiple versions of attachments was applied.


Create a MarkLogic HTTP AppServer and configuration make rewrite.xqy the default rewriter script.

You can now visit create databases and documents using futon by accessing /_utils/ (e.g. localhost:8953/_utils/)

This section doesn't cover how to set up an HTTP Application Server in MarkLogic. If you are a beginner I suggest you start by browsing the MarkLogic Developer Community site or sign up for training.


Think the documentation sucks? Think the performance is crap? Think facade is cool but is missing feature X? Then contribute to the project.

  1. Message dscape on github talking about what you want to accomplish.
  2. Fork facade in github
  3. Create a new branch - git checkout -b my-branch
  4. Develop/fix the functionality
  5. Test your changes
  6. Commit your changes
  7. Push to your branch - git push origin my-branch
  8. Create an pull request

Running the tests

To run the tests simply access /_tests/: (assuming is the host and 8090 is the port)

Make sure all the tests pass before sending in a pull request!

Report a bug

If you want to report a bug please file a issue.


(oO)--',- in caos