Fork me on GitHub
#beginners
<
2018-04-26
>
lum14:04:43

hi, for a simple web application with a form, how do you deal with https? I was thinking in setting up stunnel to deal with the SSL certificate, OCSP and then routing HTTP to the Clojure application. Since I've never set up such a thing in Clojure, would like to hear from experienced people

joelsanchez14:04:12

I think most people just use nginx as a reverse proxy

athomasoriginal14:04:36

If you want a live example a clojure app doing these kinds of things checkout https://github.com/juxt/edge

lum14:04:28

I was about to embark with the book "Web Development with Clojure 2nd ed", I wonder which is easiest for the first time

grierson14:04:34

@lum Make sure you use the hard coded versions in the book. Luminous has changed a bit since its been published.

Volodymyr Sereda14:04:26

Mhm, we just use a Compojure clojure server behind nginx which can handle all the SSL.

prozz15:04:03

hi, few questions - i just found out about clj and new way of specifing dependencies: deps.edn however cannot easily find what is the recommended way to specify some startup commands to evaluate everytime. do i always needs to use --init with clj tool? - i plan to learn boot build tool. going forward id like to use just a single place to put my deps in. i saw there is a plugin for boot to work with deps.edn, having built in support out of the box would be better tho. is there a plan for that or deps.edn is kind of experimental and suggested just for small script like usage?

gklijs15:04:10

There is https://github.com/nginx-clojure/nginx-clojure I like it, but you don’t need to have it your clojure embedded in nginx

athomasoriginal15:04:19

@prozz you might be interested to see how Robert Stuttaford works with deps.edn and the new clj tool https://github.com/robert-stuttaford/bridge. Its not just meant for scripts or small programs. It should be able to handle most things you throw its way

👍 1
prozz15:04:14

thanks for it, will read!

athomasoriginal15:04:55

https://github.com/juxt/edge is another example, a little more complex, but can really show you some interesting ways of working with it

prozz15:04:57

😄 project.clj ;; so CIDER can locate the project root

athomasoriginal15:04:28

haha seriously...

callum03:04:35

@prozz can you actually create a Cider REPL in that project? I get the following error whenever I cider-jack-in

error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate com/billpiel/sayid/nrepl_middleware__init.class or com/billpiel/sayid/nrepl_middleware.clj on classpath.

lum15:04:23

@joelsanchez Once (not with clojure), tried to configure a nginx reverse proxy with SSL for more than one site and got into some problems, my fault for sure

Denis G16:04:57

Guys, I want to create something like an adt in clojure. A tree with different kind of nodes and then visit them and do some stuff. What would you advise me to use? Obviously I need some kind of pattern matching with cond, so that I can do different actions depending on which kind of node I am at. Any suggestions?

noisesmith17:04:10

@denisgrebennicov often a multimethod is better than a cond block

noisesmith17:04:51

one approach is to use a keyword in a hash map to designate the :type of a node, then a :children key with a vector of more maps

noisesmith17:04:39

also, sometimes normalizing into an adjacency list is easier than an actual tree, depending on what kind of transformations you need to do on the structure

Denis G17:04:02

of course! multimethods! Thanks a lot!