Fork me on GitHub

Is there a way to plug a pedestal service (routes and all) into lein-figwheel's ring-handler?


@cap10morgan I'm not sure what that means. I've used lein-figwheel, but just for serving up the CLJS app. I normally run the back end (with Pedestal) in a separate process.


@mtnygard Yeah, that's what I'm trying to avoid (the separate process). lein-figwheel has a :ring-handler value you can set in project.clj, but I'd love to have it go through my pedestal routes, etc. rather than having to plug it into the ring-handler-esque guts of an interceptor (i.e. just the fn of a request that returns a response). My goal is to keep things simple for my team. The more I can give them one command to run (ideally the one that everyone else's examples online also run) to spin up their dev environments, the better. So if lein figwheel could be made to interact with the pedestal service w/o needing to run a separate command, that would be great (even if it's not via :ring-handler).


That may be useful to you


@ddeaguiar thanks I'll check it out


The message I'm getting is that neither pedestal nor (lein-)figwheel are going to help me do this. 🙂 This is a helpful starting point for achieving a similar goal though, so thanks.


I'm using ring-redis-session ( with pedestal and the :session/keyof the request parameter does not appear to be accessible anywhere (that I can find) until a second request comes through. Has anyone experienced anything like that?


@john That sounds very strange. How is the client sending that parameter?


@mtnygard I thought the ring-redis-session middleware was attaching the session key to :session/key in :request on the server side.


Hmm. OK, let me look at the source for that library for a second.


Thanks! One more strange aspect: the :session/key always remains nil unless I add some content to :request :session in some interceptor


In bare-session-request, it only attaches the :session/key if an existing session was found.


It could be that the initial request is required so that my dummy data in the :session key gets placed. Then the second request succeeds. However, if I try to put data in the :session key very early in the interceptor chain, that does not suffice.


So on the first request, there isn’t a session yet


Your handler can return a response with a session, at which point ring-session will send that cookie down. The client returns it on the next request and bare-session-handler finds the existing session for you


A caution: if you ever return a response with no session, then any existing session gets deleted!