This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-16
Channels
- # beginners (81)
- # calva (6)
- # cider (21)
- # clj-kondo (2)
- # clojure (62)
- # clojure-austin (3)
- # clojure-europe (3)
- # clojure-italy (20)
- # clojure-nl (39)
- # clojure-russia (4)
- # clojure-spec (19)
- # clojure-uk (23)
- # clojurescript (76)
- # cursive (6)
- # data-science (9)
- # datomic (12)
- # defnpodcast (1)
- # figwheel-main (3)
- # fulcro (8)
- # jackdaw (5)
- # jobs (1)
- # jobs-discuss (18)
- # joker (1)
- # leiningen (2)
- # liberator (2)
- # off-topic (148)
- # onyx (5)
- # pedestal (39)
- # planck (7)
- # re-frame (5)
- # reagent (3)
- # reitit (37)
- # shadow-cljs (165)
- # tools-deps (1)
- # yada (19)
Hi everyone ! I am planning to use Pedestal and Component to start en new micro-service. I have done some research on the idiomatic way to bootstrap Pedestal with Component using the reloaded.repl flow. I found those libraries so far : https://github.com/ddeaguiar/component-pedestal https://github.com/grzm/component.pedestal But did not find any clear answer. Did I missed some articles ? Thank you very much
I’m not sure I’m answering your question exactly, but I use component and pedestal and have been happiest using a :router
component that builds its pedestal :routes
dynamically, closing over any other stateful components; and a :jetty
component that’s responsible for the jetty http/s service.
Hi @U0508R629, glad to see that you’ll be using Pedestal. I authored ddeaguiar/component-pedestal and co-authored pointslope elements (https://github.com/pointslope/elements). I’ve not formally released the former and the later has not been updated in a while. As I’ve worked through various iterations of applications based on component and pedestal, I’ve become less inclined to mix the two.
Pedestal already provides a service representation that is extensible - the service map. You can assoc whatever you like to it and use that info during service initialization
Start/stop entry points are pretty clear. Pedestal’s extension point is also very clear - the interceptor.
All you need to do is create interceptors that make the dependency you are interested available in the context/request
I found that all the machinery I built around this for component basically involved how to create such interceptors and where should such code exist in a project
@ddeaguiar thank you very much for your answer. I am not a pedestal expert so I stick to the tools I am comfortable with. I will dig deeper to understand the true philosophy of pedestal :-)
How would you add params for testing a route with response-for
? or a different way to test request maps?
@adamgefen http://pedestal.io/reference/unit-testing should clarify this. If not, let me know so I can update it.
perfect! @ddeaguiar, I overlooked it.
....and how would you inject a session for testing session authentication :session {:identity {:username foo}}
?
@adamgefen how is authentication wired into your service now?
buddy session
it is a table in a postgresql, the project is component with a pedestal component and a postgres component (juxt.modular)
Yes you are right. I don't need to test the db connection.
I see.
Perhaps can pass in cookie with identity info, exercise stub auth and test what you want
Yes . I just need a way that it can be passed as a header.
But it can't be just the session map, can it?
thanks! 😄