Class: WebMethods

WebMethods

new WebMethods()

This mixin provides method handler functions for an express application. Those handlers are invoked from webapi() method. You could add a new method and/or replace an existing methods via webmethods() interface.
Source:
Example
var _wm = MyKago.prototype.webmethods;
MyKago.prototype.webmethods = function() {
    var wm = _wm.apply(this, arguments);

    // add a new method
    wm.mymethod = function(req, res, next) {
        var collection = req.kagodb;
        var webapi = req.webapi;
        // do some thing
    };

    // override an existing method
    var _read = wm.read;
    wm.read = function(req, res, next) {
        var collection = req.kagodb;
        var webapi = req.webapi;
        // do some thing before read
        _read.call(this, req, res, function() {
            // do some thing after read
            next();
        });
    };

    return wm;
};

Methods

count(req, res, next)

This is a bridge function to count() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

erase(req, res, next)

This is a bridge function to erase() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

exist(req, res, next)

This is a bridge function to exist() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

find(req, res, next)

This is a bridge function to find() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

findAndModify(req, res, next)

This is a bridge function to findAndModify() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

findOne(req, res, next)

This is a bridge function to findOne() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

index(req, res, next)

This is a bridge function to index() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

insert(req, res, next)

This is a bridge function to insert() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

read(req, res, next)

This is a bridge function to read() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

remove(req, res, next)

This is a bridge function to remove() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

save(req, res, next)

This is a bridge function to save() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

update(req, res, next)

This is a bridge function to update() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source:

write(req, res, next)

This is a bridge function to write() method from express webapi app.
Parameters:
Name Type Description
req Object request object
res Object response object
next function next function
Source: