3 ms·
Do you develop REST API also....? The fundamental issue is that it binds the server to the client, who must understand HTML structure. It also makes it more di
by notoriousarun 5y ago
Do you develop REST API also....?
The fundamental issue is that it binds the server to the client, who must understand HTML structure. It also makes it more difficult to reuse the endpoints in different ways or for new applications.
Returning data and letting the client render it decreases coupling and increases flexibility/testability- you can run unit tests on the client for mock data, and run unit tests on the server to test the desire
- rubyist5eva 5y agoI don't use Django but I use Ruby on Rails, and turning a server-side rendered page into an API is trivial. Rails requests automatically understand the format of a request and let you specify what do when a specific kind of format comes in: ie. when it's an html request, render this page, when it's a "js" request, render a jbuilder template. ezpz whatever frontend framework you're using has really nothing to do with it at all.
- 1337shadow 5y agoConfirmed this is also trivial with Django, have done it to my crud, and even have a view that parses my url router for views and return an openapi definition with a swagger ui.
- notoriousarun 5y agoDo you use Django REST Framework with Web Swagger Console UI?
- 1337shadow 5y agoNope, I have a view that parses my url router for views and generates an openapi schema, and a view that shows a swagger with it.