salix/loopback/common/methods/application/post.js

19 lines
387 B
JavaScript

module.exports = Self => {
Self.remoteMethodCtx('post', {
description: 'Returns the sent parameters',
returns: {
type: 'object',
root: true
},
http: {
path: `/post`,
verb: 'POST'
}
});
Self.post = async ctx => {
console.log(ctx.req.body);
return ctx.req.body;
};
};