This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-14
Channels
- # announcements (1)
- # asami (3)
- # aws (1)
- # babashka (22)
- # beginners (39)
- # calva (21)
- # clj-kondo (10)
- # cljdoc (22)
- # cljs-dev (17)
- # clojure (93)
- # clojure-australia (3)
- # clojure-europe (39)
- # clojure-italy (3)
- # clojure-losangeles (17)
- # clojure-nl (14)
- # clojure-russia (2)
- # clojure-uk (5)
- # clojurescript (35)
- # community-development (7)
- # conjure (2)
- # cursive (13)
- # data-science (1)
- # datomic (25)
- # emacs (5)
- # events (4)
- # figwheel-main (2)
- # fulcro (12)
- # graphql (7)
- # gratitude (2)
- # inf-clojure (6)
- # leiningen (6)
- # lsp (49)
- # malli (13)
- # membrane (30)
- # minecraft (1)
- # pathom (3)
- # pedestal (26)
- # polylith (13)
- # portal (2)
- # quil (3)
- # random (1)
- # re-frame (13)
- # reagent (43)
- # reitit (6)
- # releases (1)
- # reveal (2)
- # ring (3)
- # shadow-cljs (30)
- # specter (5)
- # sql (8)
- # tools-build (1)
- # tools-deps (13)
- # videos (1)
is there any way to turn off the pedestal org.eclipse.jetty
Debug messages from timbre?
I tried using com.fzakaria/slf4j-timbre
and use :ns-blacklist ["org.eclipse.jetty.*" "io.pedestal.*" "com.walmartlabs.lacinia.*"]
but it didn´t work
What version of timbre and slf4j-timbre are you using?
:ns-blacklist
is deprecated?
I am using :min-level
like so:
{:min-level [[#{"*"} :info]
[#{"*"} :warn]]}
for passing to timbre 5.1.0
and using slf4j-timbre 0.3.20which works fine
I ran into a problem where the recent log back-classic broke, resulting in slf4j based Java code, like jetty and Kafka disregarding timbre whitelists
The solution is to remove the exclusion on logback-classic for the API, then all is well
Can someone point me in the right direction. I’m trying to send a POST from my client and earlier today I did manage to send my :post field and get it to save to the database. At the moment that’s not working and i’m trying to figure out what’s going on and if this is an issue with my backend or frontend(both)? https://gist.github.com/v3gal0g/273cf964b423bfd7719d05d0722e058b
The response is nil, I see that. But i’m confused as hell because it did indeed write to my DB earlier. Now it triggers the creation of an empty row so I at least know it’s hitting that route properly, i’m just not catching the data.
Your log contains an exception. So presumably something goes wrong in your handler / pedestal ends up down the error functions of your interceptors
The exception says you are calling a map (which is legit), but don’t end up passing arguments. I think that’s somewhere else (as in, not in your gist)
Hmm, I do have the project public. Oh! That ghetto hack to pass in the architect id huh? https://github.com/v3gal0g/cybernest-xd
On pedestal context we can find "content-type" "application/transit+json"
Is it really transit? If it is transit, you should access :transit-params
(that is nil, in this case)
If is not transit, you shuold use content-type application/json
You probably will solve this on the client. The server looks fine
This should fix
(defn send-message! [fields]
(-> (js/fetch "/iots"
#js{:method "POST"
:headers #js {"content-type" "application/json"}
:body (js/JSON.strinfigy (clj->js @fields))})
(.then (fn [res] (.json res)))
(.then #(.log js/console (str "response: " %)))
(.catch #(.error js/console (str "error: " %)))))
I have a small reagent+pedestal didactic project, with just ~300 LOC It uses JSON to communicate in the API, really similar to your setup. I'm still writing the tutorial (it is incomplete) but it serves as a reference 🙂 https://github.com/souenzzo/atemoia
@U2J4FRT2T Thanks! Taking a look now… yeah i’m just now learning how to read the output and noticed I was trying to access something that doesn’t exist.
js/fetch is really interesting. I’ve never seen that before. That’s preferred over cljs-ajax?
I really like the browser API's. I (personally) don't see many value in these "magical easy ajax libraries" https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
Yeah, I won’t argue that. I’m just now starting to learn JS so I know what’s actually going on. I’ll adopt this practice.
@U2J4FRT2T will do
Ok sorry, I still have some confusion. I’m able to write to the database now from my client but it still throws a 500 and complains. What am I missing there because my map definitely is getting passed in to insert-iota
https://github.com/v3gal0g/cybernest-xd/blob/main/src/clj/cybernest_xd/db.clj#L133
clojure.lang.ExceptionInfo: clojure.lang.ArityException in Interceptor :cybernest-xd.db/insert-iota - Wrong number of args (0) passed to: clojure.lang.PersistentHashMap
This error:
`Wrong number of args (0) passed to: clojure.lang.PersistentHashMap
db.clj`
Is always result of something like (m)
or (apply m [])
where m
is a hash-map
I think that in this case, is related to the #spy/p
@U2J4FRT2T wow, that absolutely was it… thank you!