I'm confused about the meaning of API, specially in the context of REST. I'm thinking of one example.
My company creates an application that runs on a server (the "backend"). (JavaScript in Node.js)
To use it, my company also creates a user interface that runs on the browser of the client's computer (the "frontend").(React.js).
When the user enters www.my-company.com, they are provided with our frontend. They click around it which sends specific requests that access specific methods "exposed" in our backend. It responds with mostly JSONs with data.
The backend is made to be accessed only by our frontend. We don't want anything else making requests to it.
Question 1: Is the service that I just described "an API"? A lot of people talk about "developing APIs" and I want to know if that's what we are doing.
Question 2: Is our service benefited by making it REST? After reading about it I think it only benefits services that can be accessed "by anyone's app", instead of "just by our website".
The backend is made to be accessed only by our frontend. We don't want anything else making requests to it.
this is not possible once your web app is published (no matter if it's server-side rendering or SPA-API). The app is visible to everyone, endpoints are visible to everyone, and sites are accessible by all sorts of bots and scrappers, you can't prevent this from happing unless you add a security component in front. Don't conflate accessibility with authorization.