Start the REPL

A REPL will run the project code every time we save files or evaluate expressions. This provides an instant feedback loop to ensure our application does what we think it should do.

Run the browser-repl using one of the following methods.

When you see the line Successfully compiled "resources/public/app.js" browse to http://localhost:3449 to see the running app.

It may take 10-30 seconds to start the repl, especially if libraries are to be downloaded. If nothing is displayed in your browser window, give it a few seconds and refresh the browser.

Using Spacemacs or Emacs & CIDER

,' in Spacemacs to start a REPL (cider-jack-in).

, s a to switch to the REPL buffer and enter the following expressions, pressing RET to evaluate each in tern.

(go)
(cljs-repl)

Command Line & other editors

Open a terminal and type lein repl to start a Clojure REPL or start a REPL from your editor.

In the REPL, enter the following function calls then open a browser at http://localhost:3449

(run)

(browser-repl)

The call to (run) starts the Figwheel server at port 3449, which takes care of live reloading ClojureScript code and CSS. Figwheel's server will also act as your app server, so requests are correctly forwarded to the http-handler you define.

Running (browser-repl) starts the Figwheel ClojureScript REPL. Evaluating expressions here will only work once you've loaded the page, so the browser can connect to Figwheel.

When you see the line Successfully compiled "resources/public/app.js" in 21.36 seconds., you're ready to go. Browse to http://localhost:3449 and enjoy.

results matching ""

    No results matching ""