Open ghost opened 1 year ago
Here is an old commit with a zio-http twirl example project. Beware this was made for an earlier version of zio-http, and I dont know if you can migrate it to the latest version.
https://github.com/zio/zio-http/commit/a8e9fbeb52a11f5e408c0e94e87d0ae82997a106
The ZIO HTTP Handler.template
option is decent but not documented. Another option is Scala Tags. Twirl integration works and provides a decent migration path for Play users but doesn't seem like the right choice for anyone who can choose. Overall I'd vote for improving and documenting Handler.template
:)
Twirl integration works [...] but doesn't seem like the right choice for anyone who can choose.
@jamesward What's the issue with Twirl? Any drawbacks or reasons to steer clear?
Overall I'd vote for improving and documenting Handler.template :)
Documentation aside, do you know any repo or Gist with a good example? Here's a cool example, looks solid. So, this is the route you'd recommend? Still keen on hearing about Twirl though ;)
Here is where I use Handler.template
https://github.com/jamesward/javadoccentral/blob/master/src/main/scala/App.scala#L29
From what I remember, the primary reason I decided not to use Twirl was due to the lack of Scala 3 language support. ie I don't think I can use braceless syntax in Twirl templates. But maybe I'm remembering things wrong.
not to use Twirl was due to the lack of Scala 3 language support
Oh, good point! Thanks.
need some guide to make zio-http working with render html static page. Like: https://www.playframework.com/documentation/2.8.x/ScalaTemplates
What's the best practice to render html?