• Max-P@lemmy.max-p.me
    link
    fedilink
    arrow-up
    3
    ·
    11 months ago

    I’d go a step further and suggest, make your backend itself an API that uses JSON and whatever. Then the web backend talks to the API and spits out HTML. And it can do whatever is needed to support HTMX without having to worry about how it will affect the API and you can’t end up with web exclusive features unintentionally.

    And you don’t have logic duplication where you can forget to add an auth check to a web controller or the API.