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).
@lanejo01 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
so that should work for you
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.
well I don’t expect that to work
while service/routes
unwrapped works.
because the routes are not expanded
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.
what does service/routes
look like?
I've removed all of my routes from it.
because that should work
works
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.
no problem!
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.