Using middleware to create "templates" for different paths #2245
Replies: 2 comments 2 replies
-
Hi @dattaproffs I don't understand it all, but have you ever tried to use JSX Renderer middleware? |
Beta Was this translation helpful? Give feedback.
-
Hi @yusukebe thank's for your reply. Yes i started looking at it yesterday and going to setup a minimal example that we can look at. so either i will redirect by setting the htmx-location header or the context.redirect and so on. Makes some sense? I will get back with a small example. |
Beta Was this translation helpful? Give feedback.
-
Hi
i'm trying to setup a structure with middleware to support both full reload and htmx frontend using cloudflare workers.
It is working pretty good but i have som troubles understanding some things.
I have looked at https://github.com/dctanner/htmljs-todo-example wich is pretty much what i wan't to do.
Having trouble to getting redirect to work and some other set / get issues.
I will post some pseudo code below so maybe someone can tell me what i'm doing wrong and that a much better way exists :)
and so on...
The problems i'm facing is that in for example
app.post('/auth/login', VIEW )
i wan't to redirect via htmx if in that context otherwise i wan't to do a context.redirec().But when i try that it does not happen and i think it's because the several middlewares?
The second thing i have a hard time getting to work properly is to get everything typed. I have looked through issues and docs but can't seem to find anything that looks like this.
If someone could steer me in the right direction i would be greatful.
Thank's in advance and for a great project!
Beta Was this translation helpful? Give feedback.
All reactions