Complete wip: New Application Architecture
Add support for client side routing and updating without loading the AppShell
This commit is contained in:
@@ -11,8 +11,8 @@ const index = new Elysia()
|
||||
console.log(`Request ${request.method} ${request.url}`);
|
||||
})
|
||||
.onAfterHandle(({ request, responseValue }) => {
|
||||
if (request.headers.get("hx-request") === "true") {
|
||||
return responseValue; // Return the <main> element if the request is an HTMX request
|
||||
if (request.headers.get("shell-loaded") === "true") {
|
||||
return responseValue; // Return the <main> element if the AppShell has already been loaded
|
||||
}
|
||||
return AppShell(responseValue); // Return the <main> element wrapped by the AppShell
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user