I want to use a custom endpoint for POST /images; so what i thought i could override the create method of a model; this is how I'm doing it:
var loopback = require('loopback');
function overrideImageApiMethods(app){
var Image = app.models.Image,
create = Image.create;
Image.create = function create(data, clb){
var context = loopback.getCurrentContext();
};
}
module.exports = overrideImageApiMethods;
I would like to get the response object like you would do it in express; I found the getCurrentContext method returns null in the example above.
What is the correct way to about it?