Skip to content

Returning HTMX or JSON in one endpoint #2686

Answered by JacobCoffee
3tilley asked this question in Q&A
Discussion options

You must be logged in to vote

I could have two separate functions, like /api/foo and /foo but that feels like a lot of boilerplate and work to keep them in sync.

I agree, but this is how I deal with it personally at work because if I did these weird mixins I lose out of some features and clear concern separation. I hate it (the duplication) too, tbf.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cofin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Documentation 📚 This is related to documentation
2 participants
Converted from issue

This discussion was converted from issue #2685 on November 16, 2023 17:11.