django-maintenance-mode icon indicating copy to clipboard operation
django-maintenance-mode copied to clipboard

Allow response type to be conditional based on path

Open petewalker opened this issue 5 months ago • 4 comments

In our application, we have a mix of JSON API endpoints and HTML pages.

All of our API endpoints are prefixed with the path /api.

It would be good if we could conditionally return a JSON response for our /api endpoints and a HTML response for all others.

Is it possible to make this configurable? In the interim as workaround, I guess we could subclass your middleware?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

petewalker avatar Sep 23 '24 13:09 petewalker