Hasty Briefsbeta

Bilingual

Clojuring the web application stack: Meditation One

a year ago
  • #Web Development
  • #Clojure
  • #Ring
  • The post discusses the lack of a canonical web framework in Clojure, emphasizing the need to understand both web framework and application architecture.
  • It introduces the Ring project as the canonical HTTP library collection in Clojure, highlighting its design choices and influence on the ecosystem.
  • The author provides a bare-minimum web app example using Ring and Jetty, demonstrating request/response handling with Clojure hash-maps.
  • Middleware in Ring is explained as a functional mechanism for handling cross-cutting concerns like state management, error handling, and request/response transformations.
  • Routing is identified as a critical piece not included in Ring, with libraries like Compojure and Reitit recommended for polymorphic dispatch.
  • The post concludes with practical advice for beginners, suggesting starting with Ring + Jetty + Compojure + Hiccup + next-jdbc and exploring more advanced stacks like Kit, Biffweb, and Edge.