O'Reilly logo

Clojure Recipes by Julian Gamble

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5. A REST Client in ClojureScript

It’s a common pattern to write client-server applications with a JavaScript client. The inventor of Clojure, Rich Hickey, said at the announcement of ClojureScript, “Clojure rocks, JavaScript reaches.”1 He meant that it is great to be able to write Clojure that runs on the server JVM and the client browser in JavaScript. We’re going to work through a pattern for doing this.

1. ClojureScript Announcement, July 2011, https://www.youtube.com/watch?v=tVooR-dF_Ag

In this recipe we will create a client in ClojureScript that will make a REST call. Then we will reuse the REST server from the previous chapter to receive the call. We will see the entire process end to end.

Assumptions

In this chapter we assume the following: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required