Is there a foolproof way to ensure that your WebAPI controller routes stay aligned with the client-side requirements?
Let's say you have a BooksController for your WebAPI. On the client side, a method is invoked by calling the endpoint like this:
$.get('books/1');
But what happens when you rename the controller or introduce a RoutePrefix? The client-side code breaks because the endpoint changes.
I recently stumbled upon the library WebApiProxy, which seems promising. Does anyone have a clever solution to this issue? Could there be a better alternative to using string literals in the client-side code that I might not be aware of?