Thursday, June 13, 2024
HomeJavaServer-side rendering in Rust - a Dall.E use-case

Server-side rendering in Rust – a Dall.E use-case

Tokio is a runtime for asynchronous programming for Rust; Axum is an online framework that leverages the previous. I already used Axum for the earlier REST API, so I made a decision to proceed.

A server-side rendering webapp is just like a REST API. The one distinction is that the previous returns HTML pages, and the latter JSON payloads. From an architectural viewpoint, there’s no distinction; from a growth one, nevertheless, it performs an enormous function.

There’s no visible requirement in JSON, so ordering is just not a difficulty. You get a struct; you serialize it, and you’re executed. You possibly can even do it manually; it’s no huge deal – although a bit boring. Alternatively, HTML requires a exact ordering of the tags: for those who create it manually, upkeep goes to be a nightmare. We invented templating to generate order-sensitive code with code.

Whereas templating might be age-old, PHP was the language to popularize it. One writes common HTML and, when crucial, provides the snippets that have to be dynamically interpreted. Within the JVM world, I used JSPs and Apache Velocity, the latter, to generate RTF paperwork.



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments