Loopbackjs 如何获取环回3中模型的所有远程方法和端点/属性?
我试图找出模型的所有远程方法及其端点/属性?如何在环回3中获得它?在github上也有类似的讨论:Loopbackjs 如何获取环回3中模型的所有远程方法和端点/属性?,loopbackjs,Loopbackjs,我试图找出模型的所有远程方法及其端点/属性?如何在环回3中获得它?在github上也有类似的讨论: 下面是他们建议用于获取特定型号的所有远程方法的代码: function getActiveRemoteMethods(model) { const activeRemoteMethods = model.sharedClass .methods({ includeDisabled: false }) .reduce((result, sharedMethod) =>
function getActiveRemoteMethods(model) {
const activeRemoteMethods = model.sharedClass
.methods({ includeDisabled: false })
.reduce((result, sharedMethod) => {
Object.assign(result, {
[sharedMethod.name]: sharedMethod.isStatic,
});
return result;
}, {});
return activeRemoteMethods;
}