Habit: I often centralize API urls in a single file
Habit: I often centralize API urls in a single file.
Benefits:
✅ I reuse the URLs in fetch calls and mock configs (using tools like @ApiMocking)
✅ I can see all the URLs the app hits in a single spot, organized by resource, which makes it easy to see what APIs I can call, and encourages reuse
✅ I can use “Find all references” to find all the places a given URL is used
✅ I can easily notice if two pieces of code are needlessly calling the same URL, and centralize their logic to resolve it
