zio / zio-http

A next-generation Scala framework for building scalable, correct, and efficient HTTP clients and servers
https://zio.dev/zio-http
Apache License 2.0
800 stars 403 forks source link

give me some examples how to use zio-http with templates engine like thymeleaf or twirl #3157

Open Tasselmi opened 1 month ago

Tasselmi commented 1 month ago

Is your feature request related to a problem? Please describe. I want to migrate my play-framework app to zio-http, thare are lots of frontend code that written with html templates.

Describe the solution you'd like support to integrate zio-http with thymeleaf and twirl.

Describe alternatives you've considered Just don't know if there are alternatives

Additional context I have lots of code written with jekyll(a static site generation engine) and play-framework + twirl, I want to make my sites dynamic rather than static.

987Nabil commented 1 month ago

for twirl, as long as it is compiling you just call the template like in play. The Html you get back can be stringyfied by calling toString. Wrap it in a body and send it.

The others probably work similar.

But I think a play migration module for zio http might be nice.