Skip to content

Integrate Couchbase with Koa JS to access all your buckets in your middleware

License

Notifications You must be signed in to change notification settings

gauravsaluja2006/koajs-couchbase-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koajs-couchbase-connector

Integrate Couchbase with Koa JS to access all your buckets in your middleware

=========

Installation

npm install koajs-couchbase-connector

Usage

const Koa = require('koa');
const createCouchbaseConnections = require('koajs-couchbase-connector');

const app = new Koa();

// COUCHBASE SETTINGS
const couchBaseOptions = {
    connections: [
        {
            bucket: 'sample-bucket1'
        },
        {
            bucket: 'sample-bucket2'
        }
    ],
    host: "localhost",
    username: "Administrator",
    password: "mypassword"
}

app.use(createCouchbaseConnections(couchBaseOptions));

app.use(async ctx => {
    ctx.couchbase['sample-bucket1'].get('key', function (err, result) {
        // ....
    });
})

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Any contributions are most welcome.

About

Integrate Couchbase with Koa JS to access all your buckets in your middleware

Resources

License

Stars

Watchers

Forks

Packages

No packages published