4 ms·
Using Java microservices I have only a single endpoint per use case that returns different representations based on what is requested by the user agent. If its
by arcbyte 4y ago
Using Java microservices I have only a single endpoint per use case that returns different representations based on what is requested by the user agent. If its a browser it will request HTML and I use some simple Mustache libraries to format the HTML output. If json is requested then the built in json serialized does its thing. It feels quite elegant. I think there's room for some kind of automatic HTML serializer as well. Where styling can then be done directly in CSS.