0

I am trying to the Sync Ionic app with Couchbase and PouchDB for that I have used couchbase sync gateway.

Here is my sync-gateway-config.json

{
    "log":["CRUD+", "REST+", "Changes+", "Attach+"],
    "databases": {
        "test-database": {
            "server":"http://localhost:8091",
            "sync":`
                function (doc) {
                    channel (doc.channels);
                }
            `,
            "users": {
                "GUEST": {
                    "disabled": false,
                    "admin_channels": ["*"]
                }
            }
        }
    },
    "CORS": {
        "Origin": ["http://localhost:9000"],
        "LoginOrigin": ["http://localhost:9000"],
        "Headers": ["Content-Type"],
        "MaxAge": 17280000
    }
}

From terminal I execute the following command to start Sync Gateway :

./sync_gateway /ionic-pouchdb/sync-gateway-config.json

I got the error below:

2016-08-26T12:19:34.178+05:30 WARNING: Error installing Couchbase design doc: no available couch rest URLs -- db.installViews() at database.go:333 2016-08-26T12:19:34.178+05:30 FATAL: Error opening database: no available couch rest URLs -- rest.RunServer() at config.go:480

Appreciate for Help.

Note : i have already set up bucket in couchbase server.

Please find screenshot below:

enter image description here

nic
  • 929
  • 3
  • 14
  • 22

1 Answers1

0
{
    "log":["CRUD+", "REST+", "Changes+", "Attach+"],
    "databases": {
        "test-database": {
            "server":"http://localhost:8091",
            "bucket":"your bucket name",
            "sync":`
                function (doc) {
                    channel (doc.channels);
                }
            `,
            "users": {
                "GUEST": {
                    "disabled": false,
                    "admin_channels": ["*"]
                }
            }
        }
    },
    "CORS": {
        "Origin": ["http://localhost:9000"],
        "LoginOrigin": ["http://localhost:9000"],
        "Headers": ["Content-Type"],
        "MaxAge": 17280000
    }
}

May be you have to provide bucket name.

Naveen Gupta
  • 306
  • 3
  • 11