Search code examples
clojureclojurescriptread-eval-print-loopleiningencompojure

How to setup full Clojure/ClojureScript stack?


I need to make web app with clojure/clojurescript but i can't setup them properly. I don't know how to start clojure and clojurescript REPLes in one port. Or how should i do that? Clojure backend works fine. Clojurescript works fine too. But i can't start them to work together in one port. I use immutant/compojure, leiningen, figwheel. Can someone help me how to do that?

Edited:

First i started the backend REPL:

lein repl
***
ns=> (-main)

It started on 8080 port. Second is figwheel REPL:

lein fighwheel

And it starts on 9500 port. I've tried to start backend on same 9500 port but then figwheel says that port is busy. I want to know how to build web app with clojurescript in frontend?


Solution

  • You may want to take a look at this book:

    https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/

    and this library:

    https://luminusweb.com/

    I have a template project in both CLJ and CLJS you can clone and experiment:


    For deployment, you compile the CLJS code into a JavaScript "executable". This JS code is typically referenced inside of index.html or similar HTML file (see resources/public/index.html in the CLJS template repo).

    More info on the figwheel site: here and here