If the usual patchwork of web development tools and languages just isn’t cutting it for you, you need Web Development With Clojure. Clojure gives you the rich infrastructure of the JVM with the expressive power of a modern functional language. It combines excellent performance with rapid development—and you can exploit these virtues for web app development. With step-by-step examples, you’ll learn how to harness that power and richness to build modern web applications.
Author(s): Dmitri Sotnikov
Edition: 1
Publisher: Pragmatic Bookshelf
Year: 2014
Language: English
Pages: 226
Preface
Required Background
Why Functional?
Why Clojure?
Getting Your Feet Wet
Setting Up Your Environment
Your First Project
Clojure Web Stack
Routing Requests With Ring
Defining the Routes With Compojure
Application Architecture
Beyond Compojure and Ring
What We Just Learned
Liberator Services
Creating The Project
Defining Resources
Putting It All Together
Database Access
Working With Relational Databases
Report Generation
Summary
Picture Gallery
The Development Process
What’s In a Gallery
Creating The Application
Application Data Model
Task A: Account Registration
Task B: Login and Logout
Task C: Uploading Pictures
Task D: Displaying Pictures
Task E: Deleting Pictures
Task F: Account Deletion
Finishing Touches
Adding Some Style
Unit Tests
Logging
Applications Profiles
Packaging Applications
Wrapping up
Mixing It Up
Using Selmer
Upgrading To ClojureScript
SQL Korma
Creating Application Templates
Wrapping Up
Appendix A: Alternative IDE Options
Installing Eclipse
Installing Emacs
Further Alternatives
Appendix B: Syntax
Data Types
Using Functions
Anonymous Functions
Named Functions
Higher-Order Functions
Closures
Threading Expressions
Being Lazy
Structuring the Code
Destructuring Data
Namespaces
Dynamic variables
Calling out to Java
Calling methods
What About Global State?
Writing Code That Writes Code For You
The Read Evaluate Print Loop
Summary
Appendix C: Document-Oriented Database Access
Picking the Right Database
Using CouchDB
Using MongoDB