what's the best way to route /item/:uuid.json to one handler and /item/:uuid.csv to another handler?
I think Reitit can do that, not sure about pedestals router...
I am using Lacinia Pedestal and want to set some cookies to expired
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?anybody here know of a byte-range header implementation for jetty/pedestal? Use case is supporting video playback for iOS.
Perhaps you should also at the generic Clojure channel as you might get some ring-specific advice
Thanks I will
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
so perhaps you could pass in a vector of headers instead?
{"Set-Cookie" ["a=; path=/;" "b=; path=/;"]}
Not sure if that works, haven't tried it
It works…
omg
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))