compojure

Clojure web framework for designers/ front end devs [closed]

寵の児 提交于 2019-12-23 07:29:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . All of the popular Clojure web frameworks I am seeing use hiccup to generate HTML. I find hiccup is hard to have a front end design person adjust to, compared to other frameworks that parse the syntax out of templates. Is there a clojure web framework that doesn't require the front end developer to learn LISP?

How to configure OAuth with Goodreads in Clojure

眉间皱痕 提交于 2019-12-23 05:07:57
问题 I am trying to configure OAuth to use it to access data from the Goodreads API using Clojure and Compojure framework. I basically want to get a list of firends that a Goodreads member has. I should mention that I am new to Clojure and completely new to OAuth and in general to API authentication so I would really appreciate it if it could be explained as simply as possible. I tried to find the answer online but was unable to find one that would help me as many sites deal with specific OAuth

Output compojure server print statements into figwheel terminal?

99封情书 提交于 2019-12-23 04:57:13
问题 Where does pprint / println output go in compojure?/Can I get it to show up in the terminal window that the figwheel repl is running in? (Sorry if this sounds dumb, google bested my efforts). 回答1: Actually Figwheel has a related feature to cause such symptoms. All print/prn statements in your ring handlers will be "swallowed" by the Figwheel process and will either go to a log file or to the console. Here is a snippet from project.clj: :figwheel {:http-server-root "public" :server-port 3449

Clojure Clostache error - No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil

对着背影说爱祢 提交于 2019-12-23 04:22:52
问题 Am using clojure - 1.5.1, compojure - 1.1.5, clostache - 1.3.1. The template file is present under resources/public/templates folder. Code : (:require [clostache.parser :as cp]) (cp/render-resource "templates/connectionDetails.mustache" {:jmsConnectionName "Michael" :rest-conn-names ["a" "b"]})) The call to Clostache's render-resource is throwing the below Exception : Exception: java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io

Compojure: access filesystem

丶灬走出姿态 提交于 2019-12-22 10:30:03
问题 this is my project.clj file: (defproject org.github.pistacchio.deviantchecker "0.9.0" :description "A one page application for keeping track of changes on deviantart.com gallieries" :dependencies [[org.clojure/clojure "1.2.1"] [org.clojure/clojure-contrib "1.2.0"] [enlive "1.0.0"] [compojure "0.6.4"] [ring/ring-jetty-adapter "1.0.0-beta2"]] :dev-dependencies [[lein-ring "0.4.6"]] :ring {:handler org.github.pistacchio.deviantchecker.core/app} :main org.github.pistacchio.deviantchecker.core)

How to serve the stream pdf with ring

╄→尐↘猪︶ㄣ 提交于 2019-12-22 04:49:14
问题 I'm trying to serve a clj-http generated document directly via ring/compojure. I thought ring.util/piped-output-stream would work, but it seems I'm not understanding something here... This: (defn laminat-pdf-t [natno] (piped-input-stream (fn [output-stream]) (pdf [ {:title (str "Omanimali-Kuscheltierpass" natno) :orientation :landscape :size :a6 :author "Omanimali - Stefanie Tuschen" :register-system-fonts true } ;; [:svg {} (clojure.java.io/file ;; (str "/einbuergern/" natno "/svg" ))] [

Compojure routes with different middleware

北战南征 提交于 2019-12-20 08:27:58
问题 I'm currently writing an API in Clojure using Compojure (and Ring and associated middleware). I'm trying to apply different authentication code depending on the route. Consider the following code: (defroutes public-routes (GET "/public-endpoint" [] ("PUBLIC ENDPOINT"))) (defroutes user-routes (GET "/user-endpoint1" [] ("USER ENDPOINT 1")) (GET "/user-endpoint2" [] ("USER ENDPOINT 1"))) (defroutes admin-routes (GET "/admin-endpoint" [] ("ADMIN ENDPOINT"))) (def app (handler/api (routes public

Missing form parameters in Compojure POST request

瘦欲@ 提交于 2019-12-18 14:32:25
问题 I'm having problems getting the form parameters in the following Compojure example: (ns hello-world (:use compojure.core, ring.adapter.jetty) (:require [compojure.route :as route])) (defn view-form [] (str "<html><head></head><body>" "<form method=\"post\">" "Title <input type=\"text\" name=\"title\"/>" "<input type=\"submit\"/>" "</form></body></html>")) (defroutes main-routes (GET "/" [] "Hello World") (GET "/new" [] (view-form)) (POST "/new" {params :params} (prn "params:" params)) (route

Missing form parameters in Compojure POST request

假如想象 提交于 2019-12-18 14:32:12
问题 I'm having problems getting the form parameters in the following Compojure example: (ns hello-world (:use compojure.core, ring.adapter.jetty) (:require [compojure.route :as route])) (defn view-form [] (str "<html><head></head><body>" "<form method=\"post\">" "Title <input type=\"text\" name=\"title\"/>" "<input type=\"submit\"/>" "</form></body></html>")) (defroutes main-routes (GET "/" [] "Hello World") (GET "/new" [] (view-form)) (POST "/new" {params :params} (prn "params:" params)) (route

Missing form parameters in Compojure POST request

隐身守侯 提交于 2019-12-18 14:32:07
问题 I'm having problems getting the form parameters in the following Compojure example: (ns hello-world (:use compojure.core, ring.adapter.jetty) (:require [compojure.route :as route])) (defn view-form [] (str "<html><head></head><body>" "<form method=\"post\">" "Title <input type=\"text\" name=\"title\"/>" "<input type=\"submit\"/>" "</form></body></html>")) (defroutes main-routes (GET "/" [] "Hello World") (GET "/new" [] (view-form)) (POST "/new" {params :params} (prn "params:" params)) (route