jackrobertscott
10/9/2017 - 8:45 AM

frog.js

module.exports = function (Frog) {
  
  /**
   * Helper functions can go here.
   */

  Frog.uploadFrogImage = async (id, req) => {
    ...  
  };
  Frog.remoteMethod('uploadFrogImage', {
    accepts: [
      { arg: 'id', type: 'string', required: true }, // get the id of the frog to save image to
      { arg: 'req', type: 'object', http: { source: 'req' } }, // pass the request object to remote method
    ],
    returns: { root: true, type: 'object' },
    http: { path: '/:id/upload-frog', verb: 'post' },
  });

};