Middleware
At the heart of AAXT is an AdonisJS Middleware that does most of the heavy lifting. You can find the middleware in /app/middleware/htmx_middleware
.
The process is something like this:
- It intercepts a request and checks to see if you are making an HTMX request
- If not, simply carry on and send the full page back (either from cache or by rendering the template)
- If you are, extract out the target elements names from the request
- If your request exists in cache, send that back
- If not, wait for the fully rendered page and then extract out the elements that were originally requested and send them back