Skip to content

godsarmy/htmx-nunjucks-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

htmx-nunjucks-example

What's this?

Provide htmx examples applied in restAPI and nunjucks template.

Official HTMX Examples are implemented with hypermedia calls. In this project, these examples are reimplemented with pure JSON based restAPI calls with the help of htmx client side template. This project also includes some examples for htmx extensions. Backend code is implemented by Golang Gin framework for easy execution and simplicity.

Why?

Due to various reason, it is not alway easy to convert JSON restAPIs into hypermedia calls. This project leverages client side template technology to render dynamic html pages for JSON restAPIs.

Usage

  • Make sure you have go compiler and Launch make all.
  • Enter example subdirectory and launch http server by ./main.
  • Open http://localhost:8080 in browser.

Related Articles