From Flying Matamata, 9 Years ago, written in Plain Text.
Embed
  1. {
  2.   "interface":":4984",
  3.   "adminInterface":":4985",
  4.   "log":["CRUD, Access, Auth"],
  5.   "logFilePath": "/opt/customer/Couchbase/cb-sync-gateway.log",
  6.   "compressResponses": false,
  7.   "CORS": {
  8.     "origin":["*"],
  9.     "loginOrigin":["*"],
  10.     "headers":["Access-Control-Allow-Origin","DNT","X-CustomHeader","Keep-Alive","User-Agent","X-Requested-With","If-Modified-Since","Cache-Control","Content-Type"],
  11.     "maxAge": 1728000
  12.   },
  13.   "databases": {
  14.     "realize-reader": {
  15.       "server":"http://localhost:8091",
  16.       "event_handlers": {
  17.         "max_processes": 500,
  18.         "wait_for_process": "100",
  19.         "document_changed": [
  20.           {
  21.             "handler": "webhook",
  22.             "url": "https://hookb.in/EWYe5jRW"
  23.           }
  24.         ]
  25.       },
  26.       "bucket":"realize-reader",
  27.       "sync": `function (doc, oldDoc) {
  28.           if(!oldDoc) {
  29.             if(doc && doc.type && doc.userId) {
  30.               requireUser(doc.userId);
  31.               channel("user_" + doc.userId);
  32.             } else {
  33.               throw ({forbidden: "Document type and userId must be specified"});
  34.             }
  35.           } else {
  36.             if(oldDoc.type && oldDoc.userId) {
  37.               requireUser(oldDoc.userId);
  38.               channel("user_" + oldDoc.userId);
  39.             } else if(oldDoc._deleted && doc.type && doc.userId) {
  40.               requireUser(doc.userId);
  41.               channel("user_" + doc.userId);
  42.             } else {
  43.               throw ({forbidden: "Document type and userId must be specified"});
  44.             }
  45.           }
  46.       }`,
  47.       "users": {
  48.           "GUEST": {
  49.             "disabled": true,
  50.             "admin_channels": ["*"]
  51.           },
  52.           "admin": {
  53.             "admin_channels": ["*"],
  54.             "password": "testing123$"
  55.           }
  56.       }
  57.     }
  58.   }
  59. }