reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
Matheus Moreira 2020-10-29T15:54:26.214300Z

hello! i am using reitit and my router data has the following middlewares:

[reitit.swagger/swagger-feature
 reitit.ring.middleware.parameters/parameters-middleware
 reitit.ring.middleware.multipart/multipart-middleware
 ring.middleware.keyword-params/wrap-keyword-params
 reitit.ring.middleware.muuntaja/format-negotiate-middleware
 reitit.ring.middleware.muuntaja/format-response-middleware
 exception-middleware
 reitit.ring.middleware.muuntaja/format-request-middleware
 reitit.ring.coercion/coerce-response-middleware
 reitit.ring.coercion/coerce-request-middleware
 deps-injection-middleware]

ikitommi 2020-10-30T16:21:07.221800Z

reitit does not touch the original parameters. Muktipart-params are under :mulipart-params I recall. Reitit writes the coerced parameters under :parameters so one can access both raw and coerced

ikitommi 2020-10-30T16:21:45.222Z

coercion should happen to multipart paramus too, PR welcome if not so in examples

Matheus Moreira 2020-10-29T15:58:56.214400Z

questions that i have: • in examples that i saw, multipart-middleware is put at the end of the list; shouldn’t it right after parameters-middleware? is it not desirable that coercion happens to multipart parameters? for example, in my case one of my routes declares a parameter as :multipart [:map [:combat-log-file reitit.ring.malli/temp-file-part]]. • if i am not mistaken, ring puts all parameters under :param but when i use this middleware stack, they end up under :parameters and :params stays empty. is that expected? when using reitit, should i always retrieve parameters from :parameters?

Malik Kennedy 2020-10-29T20:51:32.215400Z

Any clue why if I just call my db/create-message! it works, but if I try to access it from a route / <input> form then Postgres tells me I don't have "hstore extension". How can I just see whats going on? Is there an equivelent for print-debugging for request responses? It feels entirely opaque ;_; I know what I want to say and I know how I expect it to recieve it I justg dont know why it wont

(defn save-message [{:keys [params]}]
  (db/create-message!  
      params))

(db/create-message! {:content "hello world"})

(defn home-routes []
  [""
   {:middleware [middleware/wrap-csrf
                 middleware/wrap-formats]}
   ["/" {:get home-page}]
   ["/about" {:get about-page}]
   ["/chat" 
    {:get chat-page     :post save-message}]])