thruster-rs / Thruster

A fast, middleware based, web framework written in Rust
MIT License
1.07k stars 47 forks source link

HTML templating? #103

Closed 9876691 closed 4 years ago

9876691 commented 5 years ago

Will you be adding support for server side HTML generation?

For a full stack web framework the following would be required.

page generation layouts asset management i.e. webpack (for CSS, JS and images)

trezm commented 5 years ago

I'm not sure it's wise to make our own templating engine, since so many good ones already exist!

If you check out the intro at https://thruster.pete.pm, although parts still need to be updated for 0.7, there is a quick section on using Askama for templating.

In general though, thruster is an http framework for serving requests, it's concern isn't really to dictate how the frontend is structured or generated. That being said, it might be a fun project to add a "thruster-cli page " command to the thruster-cli

For webpack and developing locally and allowing things like recompilation of your JS on save, I'd suggest a route that simply serves a file when running in development, but includes the resulting output in the binary when run in release. That way you get the best of both worlds!

trezm commented 4 years ago

Going to close this for lack of movement, although would be nice to have some middleware packages for this in the future!