pedestal

2019-10-02T04:09:16.018600Z

what's the best way to route /item/:uuid.json to one handler and /item/:uuid.csv to another handler?

orestis 2019-10-02T09:36:52.023800Z

I think Reitit can do that, not sure about pedestals router...

đź‘Ť 1
erwinrooijakkers 2019-10-02T08:06:31.019200Z

I am using Lacinia Pedestal and want to set some cookies to expired

erwinrooijakkers 2019-10-02T08:08:13.020800Z

What I tried to set multiple cookies is this interceptor:

(def make-some-cookies-interceptor
  (fn [request]
    {:status 200
     :headers {"Set-Cookie" "a=; b=; c=; path=/;"}}))
This works only for the first cookie a. I also want to create a cookie b and c. What is the correct way to create multiple cookies?

mkvlr 2019-10-02T08:50:45.022Z

anybody here know of a byte-range header implementation for jetty/pedestal? Use case is supporting video playback for iOS.

orestis 2019-10-02T09:35:52.023100Z

Perhaps you should also at the generic Clojure channel as you might get some ring-specific advice

erwinrooijakkers 2019-10-02T09:50:33.024Z

Thanks I will

orestis 2019-10-02T11:15:54.024200Z

BTW I looked into this via https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie -- it seems that you can only set one cookie at a time

orestis 2019-10-02T11:16:09.024500Z

so perhaps you could pass in a vector of headers instead?

orestis 2019-10-02T11:16:32.024700Z

{"Set-Cookie" ["a=; path=/;" "b=; path=/;"]}

orestis 2019-10-02T11:16:41.024900Z

Not sure if that works, haven't tried it

erwinrooijakkers 2019-10-02T11:23:18.025100Z

It works…

erwinrooijakkers 2019-10-02T11:23:22.025300Z

omg

Eduardo Mata 2019-10-02T15:38:47.025900Z

Howdy Y'all. I have been working on a small framework using pedestal io and integrant. The framework is used to create a server that serves user define APIs, State, Redis Processors, and Server Sent Events. Everything works greate, however, I noticed that when multiple clients are connected to the web app, the server sent events will only send data to one client at the time and it sends data in a particular order. The way the server sent events are implemented is with Core Async and the Pedestal library for SSE. such as

(def sse (chan 2046))

(defn stream-ready
"Get data from the sse channel and put it in `channel`. this is how SSE are sent to the client"
[channel context-map]
(go-loop []
  (async/put! channel (async/<! sse)))

(defn stream-data
"Put data in the sse channel"
[data]
(async/put! sse data))