4 ms·
I've skimmed the documentation and searched for the word server but I haven't been able to discover what is required on the server side. Can anyone point me in
by kwhitefoot 3y ago
I've skimmed the documentation and searched for the word server but I haven't been able to discover what is required on the server side. Can anyone point me in the right direction?
- hliyan 3y agoAnything that can serve HTML.
- domh 3y agoFrom what I understand, it's just HTML from the server, embellished with properties that get picked up client side by HTMX. So you can use anything on the server: nginx, node.js, go, php, whatever
- renerick 3y agoAny server-side language with your favorite web-framework and HTML templates system. Static files, PHP, Go, Ruby, ASP.NET Core, Spring etc, as long as you can send HTML pages and HTML partials, you are all set
- kwhitefoot 3y agoThanks. So a static site, on neocities.org, for instance can serve files in response to requests such as the examples using hx-swap="outerHtml". Is there a simple example of a static site using Htmx somewhere?
- renerick 3y ago> So a static site, on neocities.org, for instance can serve files in response to requests such as the examples using hx-swap="outerHtml" Exactly. It can serve HTML partials, or utilize `hx-select` attribute to extract required elements from a full page > Is there a simple example of a static site using Htmx somewhere? Not that I'm aware of unfortunately
- WeAddValue 3y agoThe code is not done yet but I can explain how we're going to use htmx and Hypermedia APIs for the static site of a national chess federation (it's static to avoid hacking/ddos from disgruntled russians). Every week, new chess ratings are calculated from the reports of in-person / over-the-board tournaments. At build-time (Hugo/Netlify), a static HTML fragment is created for each member and included in the site's static files. At run-time, when a member's info is requested, htmx will fetch the member's HTML fragment and insert it into the appropriate <div>. At run-time, there is no server-side code executing nor database so it's fast, highly available, and almost unhackable.