This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-27
Channels
- # beginners (113)
- # calva (39)
- # cider (18)
- # cljs-dev (19)
- # cljsrn (1)
- # clojure (80)
- # clojure-dusseldorf (1)
- # clojure-finland (1)
- # clojure-gamedev (1)
- # clojure-germany (2)
- # clojure-italy (38)
- # clojure-nl (16)
- # clojure-spec (90)
- # clojure-uk (81)
- # clojurescript (28)
- # clojutre (9)
- # cursive (47)
- # data-science (4)
- # datomic (21)
- # emacs (1)
- # events (2)
- # fulcro (11)
- # graphql (2)
- # hoplon (8)
- # hyperfiddle (23)
- # jobs (2)
- # kaocha (4)
- # lein-figwheel (1)
- # luminus (1)
- # mount (1)
- # off-topic (41)
- # pathom (5)
- # pedestal (27)
- # reitit (6)
- # remote-jobs (7)
- # ring-swagger (6)
- # shadow-cljs (42)
- # spacemacs (1)
- # sql (9)
- # tools-deps (6)
- # uncomplicate (2)
- # vim (5)
By default, the pedestal dev interceptor pprints the context when an exception occurs. Sometimes, the context can be Very Large, which makes for a hot cpu locally. Have others been sad about this, and what strategies have you employed to mitigate it?
I store datascript db in ctx
When my repl freezes, I know that pedestal is trying to print it 😞
ha ha the struggle is real
I can see two ways to deal with this and there both applications specific: 1. Leverage the existing print vars to control how much is printed. Clojure’s pprint impl respects those. 2. Implement your own dev interceptor variant which does not pprint the context.
I store datascript db in ctx
When my repl freezes, I know that pedestal is trying to print it 😞
I also occasionally find this more noisy and confusing than it is helpful, but I keep thinking for some gnarly issue one day I’ll be thankful the information is all there
Have you tried this sample? https://github.com/pedestal/pedestal-ions-sample
@ddeaguiar
I'm using proxy+ (generated by clicking in proxy checkbox)
when I call
it send's me {"message":"Missing Authentication Token"}
when I call
it return my handler, as expected
when I call
it returns {"message":"Missing Authentication Token"}
again
ATM I'm with #{["/*" :get hello]}
that returns {:body (pr-str path-info) :status 200}
to get /
to work, you need to set up the ANY
method on /
to proxy requests to the lambda. Apparently /proxy+
doesn’t handle that
Example: https://github.com/pedestal/pedestal-ions-sample/blob/master/src/ion_sample/service.clj#L142-L148
sorry @ddeaguiar. Now it's working
Choose Add Binary Media Type, add the */* type.
It will solve the fact of everything comes in base64 ?
My understanding is that by setting that, API gateway passes the data through to the ion unaltered
BTW, that last bit is an important point. Most meaningful logs will not be in the lambda logs but the compute group logs
Can pedestal still use ring middlewares as interceptors? I found the ring_middlewares sample repo but it’s in terms of pedestal 0.1.2
Hi @U9UQ36CJJ! Pedestal uses interceptors instead of middleware but there are a number of middleware that have been wrapped by interceptors (https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/http/ring_middlewares.clj) and, in most cases, it’s pretty straight forward to create interceptor wrappers of your own. Here’s a sample which does just that https://github.com/pedestal/pedestal/blob/master/samples/buddy-auth/src/buddy_auth/service.clj#L51-L72.