webjure vs compojure?

后端 未结 8 1271
囚心锁ツ
囚心锁ツ 2021-02-13 22:28

I\'ve heard of two Clojure based web application frameworks: Webjure and Compojure. Can someone let me know which is better?

8条回答
  •  有刺的猬
    2021-02-13 22:46

    Compojure has been working very well for me so far. I like the simplicity of the design, the flexibility and the fact that it encourages a nice idiomatic functional style.

    Sample server:

    (use 'compojure)
    
    (defroutes my-app
      (GET "/index.html"
        (html 
          [:h1 "Hello World!!"]
          [:body "This is some text"]))
      (ANY "*"
        [404 "Page not found"]))
    
    (run-server {:port 80}
      "/*" (servlet my-app))
    

    Note that Compojure uses Ring internally.

提交回复
热议问题