@balderdash/sails-edge
Version:
API-driven framework for building realtime apps, using MVC conventions (based on Express and Socket.io)
28 lines (23 loc) • 563 B
JavaScript
/**
* 200 (OK) Response
*
* Usage:
* return res.ok();
* return res.ok(data);
* return res.ok(data, 'auth/login');
*
* @param {Object} data
* @param {String|Object} options
* - pass string to render specified view
*/
module.exports = function sendOK (data, options) {
var config = {
logMethod: 'silly',
logMessage: 'res.ok() :: Sending 200 ("OK") response',
statusCode: 200,
logData: false,
isError: false,
isGuessView: true
};
require('./index').buildResponse(this.req, this.res, data, options, config);
};