Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richardbolt/koa-couchbase
Koa middleware for couchbase - adds this.couchbase to the context.
https://github.com/richardbolt/koa-couchbase
Last synced: 11 days ago
JSON representation
Koa middleware for couchbase - adds this.couchbase to the context.
- Host: GitHub
- URL: https://github.com/richardbolt/koa-couchbase
- Owner: richardbolt
- Created: 2014-07-29T02:47:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-29T15:37:22.000Z (over 10 years ago)
- Last Synced: 2024-12-08T16:06:18.648Z (15 days ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
koa-couchbase
=============Koa middleware that gets you a Couchbase client.
This extends Koa by adding `this.couchbase`.
Usage
-----```javascript
var koa = require('koa');
var couchbase = require('koa-couchbase');var app = koa();
var options = {
dsn: 'localhost',
bucket: 'default',
username: 'my-username',
password: 'my-password'
};app.use(couchbase(options));
app.use(function *(next) {
// Here we have access to this.couchbase which is a connection to your bucket.
var result = yield this.couchbase.get('document-id');
this.body = result.value;
})app.listen(3000);
```