This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-12
Channels
- # announcements (2)
- # beginners (36)
- # boot (6)
- # calva (2)
- # cider (18)
- # clj-kondo (1)
- # cljdoc (2)
- # cljs-dev (2)
- # clojure (130)
- # clojure-boston (1)
- # clojure-brasil (3)
- # clojure-czech (1)
- # clojure-europe (11)
- # clojure-italy (4)
- # clojure-losangeles (37)
- # clojure-nl (9)
- # clojure-seattle (2)
- # clojure-sweden (8)
- # clojure-uk (23)
- # clojurescript (13)
- # core-async (21)
- # cursive (13)
- # data-science (6)
- # datomic (12)
- # emacs (36)
- # figwheel-main (9)
- # fulcro (76)
- # juxt (2)
- # keechma (18)
- # leiningen (4)
- # off-topic (13)
- # pedestal (37)
- # re-frame (21)
- # reitit (2)
- # shadow-cljs (78)
- # spacemacs (23)
- # sql (13)
- # tools-deps (25)
- # uncomplicate (4)
- # unrepl (1)
- # vim (27)
I'm getting completely swamped with DEBUG warning messages in my repl and can't see any of my own debugging.
but I can't figure out how to control the logging level.
@braden.shepherdson logback.xml under the config directory if memory serves me right.
I like the swagger-ui route luminus provides but I want to switch to pedestal... what's an approach to integrating swagger into pedestal so that I can get a swagger ui webpage? I looked online but the various projects I happened across don't seem maintained (but please refer them anyway in case I missed one).
it seems like a nice all around pedestal based service might provide both the ability to listen to a queue and do things with that as well as have a REST interface with a user interface web page (I know that's probably a lot of things to put into every service but would allow for maximum flexibility and team access).
@joe.lane ah, I had such a file generated but couldn't see why it wasn't being picked up. turns out it needs to be in the classpath. I added it to my boot, and now I'm not drowning in messages anymore.
my new problem is that I can't get the ::http/routes (fn [] ...)
style to work. that spews errors about trying to use nil as an interceptor. the docs suggest this is allowed, and I'm hoping that doing (route/expand-routes (deref #'service/routes))
will make it dynamic for REPL based development.
but even just replacing my (route/expand-routes service/routes)
(which works) with #(route/expand-routes service/routes)
fails.
@braden.shepherdson if you are passing the service map through io.pedestal.http/default-interceptors
you don’t need to explicitly expand routes unless :io.pedestal.http/routes
is a fn
Also, the service template using ::server/routes #(route/expand-routes (deref #'service/routes))
in run-dev
to facilitate local dev
I don’t recommend using a fn for routes outside of dev because it’s evaluated on every request
yeah, I'm trying to do the same as the template (I'm using boot, not lein, so I didn't use the template directly) and I get a convoluted error when I pass a function.
hrm, and you are doing ::server/routes #(route/expand-routes (deref #'service/routes))
?
yes. as far as I can tell I'm running exactly the same setup as the template.
even just (fn [] service/routes)
explodes.
while service/routes
unwrapped works.
ah, I see.
well, (fn [] (route/expand-routes service/routes)
fails too.
io.pedestal.http/default-interceptors
will create the routing interceptor for you and, if :io.pedestal.http/routes
is not a fn, it will expand it.
I've removed all of my routes from it.
so it's just the template now.
that's what I've got.
hrm, Without seeing code I can’t determine why it’s not working. What I pasted works in a freshly generated service.
Pedestal 0.5.7, Clojure 1.9.0, and I restarted my REPL for good measure.
I'm diffing the files looking for variations.
there! I figured it out with the diff. I had shuffled some pieces between files, and then put them back. my routes had
`service/about-page
; where they needed
`about-page
which produces no error, but of course those symbols are not defined.
thanks for the help debugging. I'm new to Pedestal and struggling, as always with a new framework, to figure out the right incantations for the magic.
the sad part of this is that I'm debugging this side project during my 90-second builds at work. it just underscores the insane productivity of Clojure that I can reload things into my REPL with vim-fireplace and it's already live in my server.
it's mind-boggling that people object to parens and dynamic types when those are the two dev experiences.