This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-19
Channels
- # aws (2)
- # beginners (135)
- # boot (20)
- # chestnut (7)
- # cider (18)
- # clara (5)
- # cljs-dev (50)
- # cljsrn (30)
- # clojure (252)
- # clojure-italy (9)
- # clojure-losangeles (5)
- # clojure-russia (8)
- # clojure-spec (33)
- # clojure-uk (5)
- # clojurescript (32)
- # clr (4)
- # cursive (5)
- # data-science (1)
- # datascript (1)
- # datomic (40)
- # emacs (1)
- # fulcro (18)
- # graphql (11)
- # hoplon (3)
- # lein-figwheel (2)
- # lumo (47)
- # off-topic (2)
- # om-next (3)
- # onyx (10)
- # pedestal (22)
- # protorepl (6)
- # re-frame (7)
- # reagent (38)
- # ring (1)
- # ring-swagger (5)
- # rum (3)
- # spacemacs (19)
- # specter (5)
- # vim (13)
- # yada (16)
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
).
@cap10morgan here’s the link I meant to post re: Figwheel + Component: https://github.com/bhauman/lein-figwheel#scripting-with-component
@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 (https://github.com/clojusc/ring-redis-session) with pedestal and the :session/key
of 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?
@mtnygard I thought the ring-redis-session middleware was attaching the session key to :session/key
in :request
on the server side.
Thanks! One more strange aspect: the :session/key
always remains nil
unless I add some content to :request :session
in some interceptor
I’m looking https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session.clj#L24 at ring-sesison
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.
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