What's the difference between web service (API) implementation with REST and routing? what are the real differences between these two methods of creating a webservice :


Routing + Controller (https://www.chapterthree.com/blog/custom-restful-api-drupal-8)
REST plugin (https://www.drupal.org/docs/8/api/restful-web-services-api/custom-rest-resources)


advantages/disadvantages of both?

I think we can create a restfull API with one as with the other, isn't it?

Thanks
actually to create a wbesrvice endpoitns  in Drupal 8 we need to activate  one of or both of this 2 modules :


JSON:API module (best one): 


after the activation of this module you can
       access to all Drupal entities (user , node , taxonomy ) throw a dynamic endpoints that have this structure http://{host}/json_api/{entity_type}/{bundle}?Parameters, with the ability to fitter the result + built in pagination + sorting ex of endpoints :


/jsonapi/node/article : get a json contains all node article.
/jsonapi/node/article,sort=-created : get a json contains all node article and order them with e created field in DESC
order.article.
/jsonapi/taxojomy_term/article : get a json contains all taxnomy term category.



  understand the Drupal entity type first will be better :
  https://www.youtube.com/watch?v=FrSjwe8bh7I
  
  then use the  JSON:api using this videos :
  https://www.youtube.com/watch?v=--ZL3EAhnwc&amp;list=PLZOQ_ZMpYrZsyO-3IstImK1okrpfAjuMZ



RESTful Web Services


Exposing Views using the RESTful Web Services module( Do you need an easy configuration from backoffice to set up and endpoint ?) https://www.youtube.com/watch?v=TMvNwRVJSEQ.
Creating a Custom REST Resources to expose data that can’t be exposed by the previous solution - when to use  this solution when none of the previous solution can expose this data (Does JSON:API  and View exposing can't expose this type of data ?)



note : the methos in this url https://www.chapterthree.com/blog/custom-restful-api-drupal-8 never use it because we get out of the context of drupal, and you waon't be able to use a hiddne power of Rest module ex  :l by default any custom rest endpoint will display i if rest ui (https://www.drupal.org/project/restui) module installed .