Are there any deps.edn-based tutorials on how to develop ring apps and deploy it to a cloud? It seems always all I found base on lein. I'm wondering how to run-jetty automatically after I start and jack in to the repl, any ideas?
This is pretty good, uses ring, deploys to fly: https://ryanmartin.me/articles/clojure-fly/ Also gives you a DB and integrant system setup plus aero for config.
This is also very good, skips integrant for custom system setup so perhaps simpler to get started: https://caveman.mccue.dev/ Also uses ring, but build and deployment steps are missing at the moment. But still very good, definitely worth your time. There’s also a Slack channel #caveman
I can think of a couple of options:
1. Embed your own nREPL server and invoke your start logic after starting the server
2. Have a side-effectful user.clj somewhere on your development classpath
3. If you’re using Emacs and Cider, use the ns-refresh hooks to start your dev system
4. If you’re using Emacs, write an Emacs Lisp function to jack in and then send your start up code to your running nREPL server
Caveat emptor: one and two are problematic — you could end up unable to start a REPL.
Thanks, James! Thanks for providing so many options.
What about following one of those tutorials, but converting it yourself to deps instead of lein? Or just stick with lein. If you prefer to use deps, then knowing how to convert is a useful skill because there are a lot of lein-based libraries out there.
You're right, I've fallen back to use lein at the moment, I feel like its docs are better besides its popularity.
Hi, Luminus template is great choice. @yogthos wrote a brilliant book called " Web development with Clojure" . It is into its 3rd edition now. It helped me a lot. Great book
Hi, nowadays I'd recommend using Kit which is the successor to Luminus https://kit-clj.github.io/ It's similarly structured, but uses deps and integrant which have become the more popular choice for tooling over the years. Kit also has the advantage of modules where new functionality can be injected in an existing project after it's been created.
when is the 4th edition coming?
I might give it a shot if I get some time. Glad to hear you enjoyed the last one by the way. Thanks for the kind words!