Hi all. Are people still using buddy-auth
? What about for apps that use reitit
for routing? Any promising alternatives?
I think the general consensus is that the various Buddy submodules are fine to use in production (although it's confusing that the root repo seems to be unmaintained).
There is a reitit-buddy-auth example in the repo https://github.com/metosin/reitit/tree/master/examples/buddy-auth
Thanks!
How to debug this error? I create a brand new project but get IllegalArgumentException: no conversion to symbol Clojure lein new re-frame duck
Retrieving re-frame/lein-template/2.1.2/lein-template-2.1.2.pom from clojars
Retrieving re-frame/lein-template/2.1.2/lein-template-2.1.2.jar from clojars
Generating re-frame project.
➜ Clojure cd duck
➜ duck shadow-cljs run
shadow-cljs - config: /home/hovgaard/Clojure/duck/shadow-cljs.edn
shadow-cljs - updating dependencies
Retrieving thheller/shadow-cljs/2.12.5/shadow-cljs-2.12.5-aot.jar from https://repo.clojars.org/
shadow-cljs - dependencies updated
running: npm install --save --save-exact react@17.0.1 react-dom@17.0.1
added 101 packages, and audited 102 packages in 2s
3 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
IllegalArgumentException: no conversion to symbol
clojure.core/symbol (core.clj:596)
clojure.core/symbol (core.clj:589)
shadow.cljs.devtools.cli-actual/do-clj-run (cli_actual.clj:70)
shadow.cljs.devtools.cli-actual/do-clj-run (cli_actual.clj:65)
shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:126)
shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:116)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:177)
shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)
clojure.core/apply (core.clj:669)
clojure.core/apply (core.clj:660)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)
shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:665)
clojure.core/apply (core.clj:660)
shadow.cljs.devtools.cli/-main (cli.clj:75)
shadow.cljs.devtools.cli/-main (cli.clj:67)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core/apply (core.clj:665)
clojure.main/main-opt (main.clj:514)
clojure.main/main-opt (main.clj:510)
clojure.main/main (main.clj:664)
clojure.main/main (main.clj:616)
clojure.lang.Var.applyTo (Var.java:705)
clojure.main.main (main.java:40)
duck clojure --version
Clojure CLI version 1.10.3.822
duck java --version
openjdk 11.0.10 2021-01-19
OpenJDK Runtime Environment 18.9 (build 11.0.10+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9, mixed mode, sharing) (
Hello! I'm trying to use the basic swagger ui using reitit-swagger-ui but the webpage gives me an error and I just can't seem to figure out why. I'm generally copying from this project: https://github.com/metosin/reitit/blob/master/examples/ring-swagger/src/example/server.clj And the code is this:
(def app
(ring/ring-handler
(ring/router
[["/swagger.json"
{:get {:no-doc true
:swagger {:id "2.0"
:info {:title "my-api"
:description "something"}}
:handler (swagger/create-swagger-handler)}}]
["/api"
{:swagger {:id :my-api}}
["/checkImage"
{:post {:summary ""
:parameters {:multipart {:file multipart/temp-file-part}}
:responses {200 {:body {:errors true}}}
:swagger {:consumes ["image/jpg"]}
:handler checkImage}}]]]
{:data {:middleware [swagger/swagger-feature
multipart/multipart-middleware]}})
(ring/routes
(swagger-ui/create-swagger-ui-handler
{:path "/"})
(ring/create-default-handler))))
@alan.hovgaard I suspect shadow-cljs is expecting a more recent version of Clojure (the language itself, not the CLI script). Check project.clj
and see what version of org.clojure/clojure
it has specified.
@xarlyle0 you may need to ask in #ring-swagger or #reitit if you don’t get a response here within another 30 minutes…
Already asked in #reitit some hours ago. Thought someone here might know by chance
Ah, sorry 😞
shadow-cljs watch app work fine... I used "shadow-cljs run" which needs more args. thx to thheller who replied in shadow-cljs channel. .. thx for reply seancorfield
@seancorfield It's interesting. I'm looking deeper into this and when I replace the "/swagger.json" endpoint with this:
["/swagger.json" {:get {:handler (constantly {:status 200 :body "{\"swagger\": \"2.0\", \"x-id\": \"something\", \"paths\": {\"/api/checkImage\": {\"get\": {}}} }"})}}]
It works in a basic sense. But the output of things like the reitit swagger handler and the ring-swagger lib produces strings like this:
[:swagger "2.0"][:info {:title "Something", :version "1.0.0", :description ""}][:produces ["application/json"]][:consumes ["application/json"]][:paths {"/api/checkImage" {:post {:responses {:default {:description ""}}}}}][:definitions {}]
Swagger seems to want an actual JSON formatted text, but all these APIs don't produce that. This is bafflingNo idea, sorry. I’ve never used Reitit (or Swagger).
That latter output looks like something is turning a hash map into a seq though.
Okay. I think it's looking like I'm missing a middleware to change the data returned by these APIs into JSON format. Though none of the examples on reitit's docs specify you need this.. weird
You might also want to compare your list of middleware against what’s in that example project — in case something is mi… yup.
muuntaja does that, I thought?
I think so
https://github.com/metosin/reitit/blob/master/examples/ring-swagger/src/example/server.clj#L74-L91
Okay that worked! Though I'm not sure which of those middlewares were the actual one I was missing. I will suggest this be added to the docs on #reitit
Hi guys
I’m working on a web application. I want to link the menu options, to specific part of the page (in-page navigation) I’m having a problem, when I click the links of the menu, they are doing nothing…
This is my navbar component:
Links [“nosotros” “historia” “productos”]
An example of the object I want to link:
What am I doing wrong?
@vfernandez11 shouldn't there be something before the pound symbol?
e.g i'm seeing what you have as #<link>
when what i imagine you need is <link>#section
In my case <link> is just the id of the :h1
If I link to another site eg https://www.google.com/ it's works well, but when use an anchor tag, the link do nothing