Parsoid/Setup/RESTBase

This page documents how to configure RESTBase to point at a local Parsoid instance.

Tweaking Cassandra
RESTBase requires Cassandra for backend storage. However, the default configuration of Cassandra (on Debian, at least) is more suited for production than local development. For example, Cassandra's default configuration attempts to consume between 800M and 4G of memory for its heap, which can be a substantial fraction of total memory available on a developer's local machine.

After installing Cassandra, I recommend making the following configuration changes to reduce its memory footprint.

Add the following to : (There are probably already commented-out lines in  defining these; uncomment the lines and tweak the values.)

Make the following changes to :

Pointing RESTBase at a local Parsoid
Checkout RESTBase and copy  to   inside the restbase directory, if you have not already done so.

In your  there is a clause like:

Do what the comment says to do; that is, change the  value to: parsoidHost: http://localhost:8000 Make sure the port matches the value of  set in   (or   if you have followed the developer setup instructions). The default port is 8142 if using the Debian/Ubuntu packages, and 8000 if running Parsoid from a source checkout.

Now you need to add a domain for your local wiki. In  there is a section like: You want to edit it to read: Note that the part after  must match the domain of the api.php endpoint of your local wiki.

There's another section like: If needed, edit the  here to match the URL of the api.php endpoint on your local wiki. For example, if your Parsoid  contains: Then you need:

There doesn't seem to be a way to specify different apiURI values for different domains, except by substituting the value of the domain in. If different domains have different path structures, you are out of luck.

You may also wish to change the default restbase port, in the  clause at the bottom of. RESTBase's starts up on port 7231 by default.

Note that RESTBase doesn't care what "prefix" Parsoid uses to describe your wiki (the first argument to ). It just cares about the domain part of the  URL, and both RESTBase, Parsoid, and the web server actually serving   must agree on this.

Configuring VisualEditor
Once https://gerrit.wikimedia.org/r/214351 is merged, configuring VisualEditor to point to your local RESTBase is easy!

Add the following to your : And, optionally, for direct access to the RESTBase server from client-side code: