lib/responsehandler.js
function prepareMeta(response, status) {
  switch(status) {
    case CODE_OK:
      response._meta = { "message": MESSAGE_OK,
                         "statusCode": CODE_OK };
      break;
    case CODE_NOTFOUND:
      response._meta = { "message": MESSAGE_NOTFOUND,
                         "statusCode": CODE_NOTFOUND };
      break;
    case CODE_NOTIMPLEMENTED:
      response._meta = { "message": MESSAGE_NOTIMPLEMENTED,
                         "statusCode": CODE_NOTIMPLEMENTED };
      break;
    case CODE_SERVICEUNAVAILABLE:
      response._meta = { "message": MESSAGE_SERVICEUNAVAILABLE,
                         "statusCode": CODE_SERVICEUNAVAILABLE };
      break;
    default:
      response._meta = { "message": MESSAGE_BADREQUEST,
                         "statusCode": CODE_BADREQUEST }; 
  }
}
function prepareMeta(response, status) {
  switch(status) {
    case CODE_OK:
      response._meta = { "message": MESSAGE_OK,
                         "statusCode": CODE_OK };
      break;
    case CODE_NOTFOUND:
      response._meta = { "message": MESSAGE_NOTFOUND,
                         "statusCode": CODE_NOTFOUND };
      break;
    case CODE_NOTIMPLEMENTED:
      response._meta = { "message": MESSAGE_NOTIMPLEMENTED,
                         "statusCode": CODE_NOTIMPLEMENTED };
      break;
    case CODE_SERVICEUNAVAILABLE:
      response._meta = { "message": MESSAGE_SERVICEUNAVAILABLE,
                         "statusCode": CODE_SERVICEUNAVAILABLE };
      break;
    default:
      response._meta = { "message": MESSAGE_BADREQUEST,
                         "statusCode": CODE_BADREQUEST }; 
  }
}
function prepareMeta ( response , status ) { switch ( status ) { case CODE_OK : response . _meta = { "message" : MESSAGE_OK , "statusCode" : CODE_OK } ; break ; case CODE_NOTFOUND : response . _meta = { "message" : MESSAGE_NOTFOUND , "statusCode" : CODE_NOTFOUND } ; break ; case CODE_NOTIMPLEMENTED : response . _meta = { "message" : MESSAGE_NOTIMPLEMENTED , "statusCode" : CODE_NOTIMPLEMENTED } ; break ; case CODE_SERVICEUNAVAILABLE : response . _meta = { "message" : MESSAGE_SERVICEUNAVAILABLE , "statusCode" : CODE_SERVICEUNAVAILABLE } ; break ; default : response . _meta = { "message" : MESSAGE_BADREQUEST , "statusCode" : CODE_BADREQUEST } ; } }
Prepares and adds the _meta to the given API query response
@param {Object} response JSON representation of the response
@param {Number} status Integer status code
Prepares and adds the _meta to the given API query response