flexrep.createAppserver( cfg as element(configuration), group as (Number|String), name as String, port as (Number|String), db as (Number|String) ) as element(configuration)
This function creates a flexrep App Server programatically, without needing to know all of the specific settings.
const flexrep = require('/MarkLogic/flexrep'); const admin = require('/MarkLogic/admin'); const cfg = admin.getConfiguration(); admin.saveConfiguration( flexrep.createAppserver( cfg, xdmp.group('Default'), 'Replica-server', 8010, xdmp.database('Replica')));
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.