strongloop loopback 禁用指定API

https://loopback.io/doc/en/lb2/PersistedModel-REST-API.html#update--insert-instance


https://loopback.io/doc/en/lb2/Exposing-models-over-REST.html


https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html



 Admins.disableRemoteMethod("create", true);
  Admins.disableRemoteMethod("insert", true);
  Admins.disableRemoteMethod("upsert", true);
  Admins.disableRemoteMethod("updateAll", true);
  Admins.disableRemoteMethod("updateAttributes", true);
  //
  Admins.disableRemoteMethod("find", true);
  Admins.disableRemoteMethod("findById", true);
  //replace
  //
  Admins.disableRemoteMethod("deleteById", true);
  //
  // Admins.disableRemoteMethod("confirm", true);
  Admins.disableRemoteMethod("findOne", true);
  Admins.disableRemoteMethod("count", true);
  Admins.disableRemoteMethod("exists", true);
  Admins.disableRemoteMethod("replaceById", true);
  Admins.disableRemoteMethod("update", true);
  Admins.disableRemoteMethod("upsertWithWhere", true);
  Admins.disableRemoteMethod("replaceOrCreate", true);
  Admins.disableRemoteMethod("change-stream", true);
  // Admins.disableRemoteMethod("exists", true);
  // Admins.disableRemoteMethod("resetPassword", true);

  Admins.disableRemoteMethod('create', true);				// Removes (POST) /products
  Admins.disableRemoteMethod('upsert', true);				// Removes (PUT) /products
  Admins.disableRemoteMethod('deleteById', true);			// Removes (DELETE) /products/:id
  Admins.disableRemoteMethod("updateAll", true);				// Removes (POST) /products/update
  Admins.disableRemoteMethod("updateAttributes", false);		// Removes (PUT) /products/:id
  Admins.disableRemoteMethod('createChangeStream', true);	// removes (GET|POST) /products/change-stream
  Admins.disableRemoteMethod('create', true);	// removes (GET|POST) /products/change-stream


你可能感兴趣的:(Node)