This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-10
Channels
- # announcements (4)
- # babashka (29)
- # beginners (15)
- # calva (4)
- # cljs-dev (1)
- # clojure (28)
- # clojure-dev (13)
- # clojure-europe (3)
- # clojure-india (1)
- # clojure-spec (7)
- # clojure-uk (5)
- # clojurescript (37)
- # component (2)
- # conjure (60)
- # cursive (2)
- # datomic (1)
- # emacs (1)
- # figwheel-main (18)
- # fulcro (38)
- # graalvm (6)
- # graphql (13)
- # helix (14)
- # jobs-discuss (1)
- # joker (5)
- # lein-figwheel (2)
- # nrepl (3)
- # off-topic (15)
- # other-languages (1)
- # other-lisps (1)
- # pedestal (2)
- # reagent (8)
- # reitit (44)
- # shadow-cljs (83)
- # slack-help (8)
- # spacemacs (1)
er… i don’t think it’s true that it’s “super outdated and no longer maintained.” it’s pretty well-maintained and the latest release was from 6 days ago (https://github.com/gregsh/Clojure-Kit/releases). speaking from my personal experience of actually using it, it’s still a pretty good, open-source option that aims to remain minimalistic.
I have a reitit server and a reagent template and I'm trying to allow CORS. I've tried using wrap-cors from ring middleware but am having trouble getting it to work. Has anyone else experience this?
(def app2
(ring/ring-handler
(ring/router
[["/" {:get {:handler index-handler}}]
["/items"
["" {:get {:handler index-handler}}]
["/:item-id" {:get {:handler index-handler
:parameters {:path {:item-id int?}}}}]]
["/about" {:get {:handler index-handler}}]]
{:data {:coercion reitit.coercion.spec/coercion
:muuntaja m/instance
:middleware [params/wrap-params
muuntaja/format-middleware
coercion/coerce-exceptions-middleware
coercion/coerce-request-middleware
coercion/coerce-response-middleware]}})
(ring/create-default-handler)))
Try calling the end points directly I.e ‘/items’, without the <localhost://portnumber/|localhost://portnumber/>
thanks, that didn't work because the frontend is on port 3449 and the backend is on 3000
what's the idiomatic way to determine if a vector contains an element (i know contains?
looks up the index, not the val) is it to: (contains? (set ['1 '2 '3]) '3)
?
If it's an operation you need to perform repeatedly, I'd consider using a different data structure (than a vector). What's going to be idiomatic as a solution is going to depend on the problem you are trying to solve...?
thanks - i guess my question is better phrased as what are ways to check that a vector contains a value?
(some #{42} my-vec)
is a common way to test if my-vec
contains the value 42