Ignore:
Timestamp:
11/24/13 18:43:47 (11 years ago)
Author:
hendrikvanantwerpen
Message:

Changes for validation

  • Split command line wrappers from processing logic.
  • Created a JSON Schema for the database
  • Allow off-line validation of database documents.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/server/util/couch.coffee

    r478 r479  
    33Q = require 'q'
    44
     5class CouchError extends Error
     6 
    57class CouchDB
    68    constructor: (url) ->
     
    2931            'accept': 'application/json'
    3032        body: JSON.stringify (stringifyFunctions (data || {}))
    31     request(url, options)
     33    req = request(url, options)
     34    req.response
    3235    .then (res) =>
    33         JSON.parse res
     36        req.then (res) =>
     37            JSON.parse res
     38        , (err) =>
     39            Q.reject (JSON.parse err)
    3440    , (err) =>
    35         Q.reject (JSON.parse err)
     41        Q.reject err
    3642
    3743stringifyFunctions = (value) ->
Note: See TracChangeset for help on using the changeset viewer.