Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Khaled Pendleton
Khaled Pendleton
20,430 Points

Is an api endpoint just a regular route?

I don't really see a difference between the "endpoint" made in this video and the routes made in the rest of the course EXCEPT for the type of data that is returned to the client. Is this all an endpoint is? Is it just a basic route that instead of returning HTML or Javascript it returns JSON?

1 Answer

Is this all an endpoint is? Is it just a basic route that instead of returning HTML or Javascript it returns JSON?

Yeah, basically. The term 'endpoint' conceptually differentiates the route as something to be consumed programmatically by any client rather than just visited by a browser, but it's technically the same thing. Your API endpoint can actually return anything, including HTML (imagine being able to request parts of a webpage, like a button that some company wants styled in a particular way).