A CouchDB adapter for DADI API
Clone or download
Latest commit 9e69026 Jul 12, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config feat: add postinstall script Feb 20, 2017
docs test: update coverage Feb 21, 2017
lib feat: select only specified fields for return Feb 21, 2017
scripts feat: add postinstall script Feb 20, 2017
test feat: select only specified fields for return Feb 21, 2017
.gitignore tests: add test suite and coverage Feb 14, 2017
.travis.yml feat: add CI build Feb 12, 2017
README.md test: update coverage Feb 21, 2017
config.js first commit Feb 12, 2017
docs-conf.json doc: add jsdoc Feb 21, 2017
index.js first commit Feb 12, 2017
package.json doc: add jsdoc Feb 21, 2017

README.md

API CouchDB Adapter

npm (scoped) coverage Build Status JavaScript Style Guide semantic-release

Requirements

Tests

To run the test suite you'll need a CouchDB server running on localhost with the default port of 5984. If you've changed the default port, modify the test configuration file at config/couchdb.test.json. This file is created from config/couchdb.test.json.sample the first time the test suite is run.

Run the tests:

$ git clone https://github.com/dadi/api-couchdb.git
$ cd api-couchdb
$ npm test

Configure

Configuration Files

Configuration settings are defined in JSON files within a /config directory at the root of your API application. DADI API has provision for multiple configuration files, one for each environment that your API is expected to run under: development, qa and production.

The naming convention for CouchDB configuration files follows the format couchdb.<environment>.json

For example:

couchdb.development.json
couchdb.qa.json
couchdb.production.json

Application Anatomy

my-api/
  config/            # contains environment-specific
                     # configuration properties
    config.development.json
    config.qa.json
    config.production.json
    couchdb.development.json
    couchdb.qa.json
    couchdb.production.json

  main.js            # the entry point of the app

  package.json

  workspace/
    collections/     # collection schema files
    endpoints/       # custom Javascript endpoints

Configuration

[TODO]