So I was doing a sample app that will have an offline functionality.
I have 2 buckets on my couch server hosted on my local machine, first is restful-sample
and the other is sync_gateway
. Now I already have written the api code for the backend and the CRUD is all working fine. For the restful-sample
I have this config.json
located on my project.
- app
- models
- node_modules
- public
- routes
- app.js
- config.json <-- this one
...
config.json
{
"couchbase": {
"server": "127.0.0.1:8091",
"bucket": "restful-sample",
"password": "123456"
}
}
And then I also installed the sync_gateway
on my machine and I also have this json config also located at the same project.
- app
- models
...
- config.json
- syncgw-config.json <-- this one
...
syncgw-config.json
{
"interface": ":4987",
"adminInterface": ":4988",
"log": ["CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Shadow", "Shadow+", "Changes", "Changes+"],
"databases": {
"cool_app": {
"server": "http://localhost:8091",
"bucket": "sync_gateway",
"sync": `function(doc) {
channel(doc.channels);
}`,
"users": {
"GUEST": {
"disabled": false,
"admin_channels": ["*"]
}
},
"shadow": {
"server": "http://localhost:8091",
"bucket": "restful-sample",
"password": "cuaju_05"
}
}
}
}
The first bucket restful-sample
already has some data on it, stored via the API I created, written directly from the client side.
When I tried to run ./sync_gateway '/var/www/html/couchtest/syncgw-config.json'
the sync gateway is running smoothly on http://localhost:4987/cool_app/
BUT the documents from the bucket restful-sample
is not synced nor showing on the sync_gateway
bucket on couchbase server running locally on my machine.
My question here is, am I doing it right? I am expecting to see the data from restful-sample
to snyc_gateway
bucket, am I expecting too much?