For my fourth blog, I read “Best Practices for Naming REST API Endpoints” from the DreamFactory blog. The article goes over why having clear and consistent endpoint names makes a huge difference when you’re building a REST API. It talks about keeping things simple, using nouns instead of verbs, and organizing paths in a predictable way so the front end always knows where to send requests. After doing last Thursday’s activity in class, this article made even more sense because we actually saw the front end using the backend endpoints in real time.
The article explains that endpoints should describe resources, not actions. So instead of naming something /createGuest, the path should be /guests and the HTTP method determines what happens. That lined up exactly with how our project is set up. When we ran the front end with Vite and used the Lookup page, the browser sent a GET request to /guests/:id. When we registered someone, it sent a POST to /guests. Seeing those requests in the Network tab felt like watching the article play out right in front of me.
In class, we also looked at the front end state diagram, which shows the Lookup page, the Not Found modal, the Registration page, and the Registered modal. Each button or action sends a request to the backend. The article helped me understand why that flow works smoothly the backend has clean, predictable endpoint names. If the paths were messy or inconsistent, the front end wouldn’t know what to call, and the whole flow would break down.
When we opened the developer tools and watched the requests being sent, it was easy to follow what was going on because everything was named clearly. GET pulled data, POST created a record, and PUT updated it. The article talks about how important this kind of consistency is, and now I get why. It’s not just about writing code that looks nice. It’s about making the API something the front end can rely on without confusion.
I picked this article because it connected perfectly to what we did in class. Seeing the front end interact with the backend made the concepts feel real. The article basically put words to what we were experiencing: clean endpoint design makes everything easier for developers, for debugging, and for keeping the system logical as it grows.
My main takeaway is that backend decisions show up everywhere, even on the front end. Good naming makes the whole system easier to understand, and after Thursday’s activity, I see how important that is when everything starts working together.
Link: https://blog.dreamfactory.com/best-practices-for-naming-rest-api-endpoints
From the blog CS@Worcester – Harley Philippe's Tech Journal by Harley Philippe and used with permission of the author. All other rights reserved by the author.
