I am successfully connecting my couchbase server with my application using localhost:3000
var express = require('express');
var bodyParser = require("body-parser");
var couchbase =require("couchbase");
var request = require("request");
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended:true}));
var cluster = new couchbase.Cluster('couchbase://localhost');
cluster.authenticate('Administrator', 'ABcd1234');
var bucket = cluster.openBucket('non-med'); //the name of bucket is 'example'
bucket.on('error', function(err) { console.log('Bucket: CONNECT ERROR:', err);});
module.exports.bucket = bucket;
var routes = require("./routes.js")(app);
var server = app.listen(3000, function(){
console.log("Listening on port%s...", server.address().port);
});
I have also downloaded Couchbase Sync Gateway from on my mac in commend line and service is loaded shown as follows
sudo ./sync_gateway_service_install.sh
chown: sync_gateway: illegal user name
chown: sync_gateway: illegal user name
/Library/LaunchDaemons/com.couchbase.mobile.sync_gateway.plist: service already loaded
Could everyone tell you how can i configure the Conuchbase Sync Gateway in detail??
- Any amendment on the app.js
Is there any new file needed to create e.g. sync-gateway-config.json? If so,
(2a)Where do i include this file? My application project folder?
(2b)May i know the format of json?
Thanks