Skip to content

willwhite/couchdb-attachments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 

Repository files navigation

Connect middleware that serves document attachments from CouchDB.

Example

Consider the following code:

var couchdbAttachments = require('couchdb-attachments');
app.use(couchdbAttachments({database: 'users', prefix: 'users/images'}));

When a request arrives for /users/images/foo/56/profile.jpg, this middleware will look for an attachment called profile.jpg, on the document with _id 56, in the database users.

Dependencies

Configuration

Configure with a single argument, which is an object containing options.

Possible options:

  • database, the name of the database load attachments from.
  • prefix, the prefix of the external path to respond to.
  • connectionOptions, any additional connection options to pass to cradle.

About

Middleware for Connect that can serve attachments from CouchDB documents.

Resources

Stars

Watchers

Forks

Packages

No packages published