routesweb-deploymentrest

What is the difference between an API and routes/endpoints?


I am new to the web world and I just read the difference between a route and an endpoint.

I know the definition of an API. But what is the difference between an API and routes (endpoints)?

It seems to me, when somebody says "build an API" or according to the YouTube tutorials that I have watched, they simply build a route using web frameworks like Express.js or Flask like '/hello', which returns "hello".

If that is an API, are an API and a route interchangeable? Like, if I have, for example, 3 routes: '/hello', '/users', '/users/<userId>'. Can I say I have 3 APIs?


Solution

  • In short to my mind: