1
votes

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?

1
Please add a detailed example of what you have tried to do. - Alan Thompson
Open-ended questions like this one are usually not well received on Stack Overflow. stackoverflow.com/help/how-to-ask You might find more useful asking people on r/clojure reddit.com/r/Clojure and ClojureVerse clojureverse.org. Anyway, as @AlanThompson suggested, I would also recommend Luminus, which is kind of a CLI that helps you configure a web app with a Clojure backend and a ClojureScript frontend. - jackdbd
That's not what I asked but this helps me to find answer so I close this question. Thank you. - Alex Stoyanov

1 Answers

2
votes

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