Post #2254524
2026-05-07 09:02 UTC
Replies (2)
-
@obelix@chaos.social 2026-05-07 09:13
@braid@alpaka.garden My quick-win framework is Flask or FastAPI (both Python) for this kind of task.
-
@dolanor@hachyderm.io 2026-05-07 13:24
@braid@alpaka.garden Hi, totally shameless plug, but I tried to create something like that for a few years and succeeded to a certain level. It's https://rip.rest and it's basically a RESTful (not totally there yet, HATEOAS is missing) server. I tried to make it pluggable, so it doesn't bleed everywhere in your code base. And your business logic is basically the type you define. One of the smallest example is this: https://github.com/dolanor/rip/blob/main/examples/gormprovider/main.go And this allow you to have different representation of the resource based on content negociation. So if you want the JSON, send the "Accept: application/json" header. If you want HTML, "Accept: text/html" header will do. My default HTML templates use HTMX, to reduce JS to nothingness, while still making the webpages dynamic. And if you want to change it to create whatever HTML representation of your resource, just override it: https://github.com/dolanor/rip/blob/main/examples/html-template/main.go