Questions tagged [reitit]

Reitit is a fast data-driven router for Clojure(Script).

Examples

Simple route:

["/ping"]

Two routes:

[["/ping"]
 ["/pong"]]

Routes with route arguments:

[["/ping" ::ping]
 ["/pong" {:name ::pong}]]

Routes with path parameters:

[["/users/:user-id"]
 ["/api/:version/ping"]]
[["/users/{user-id}"]
 ["/files/file-{number}.pdf"]]

Route with catch-all parameter:

["/public/*path"]
["/public/{*path}"]

Full documentation is available here.

19 questions
0
votes
0 answers

Luminus- accessing data from a REST API route in a selmer template

I would like to make a Luminus app that provides a REST API and serves data from that API in Selmer templates. However, I can't figure out how to get the routing to work. For example, if you create a luminus template using the command lein new…
0
votes
1 answer

How can I set the origin header param as mandatory in Reitit?

I've a Clojure application with Pedestal & Reitit and I need the origin header param to be mandatory. ;; deps [io.pedestal/pedestal.service "0.5.5"] [pedestal/pedestal.jetty "0.5.5"] [reitit-pedestal "0.5.5"] [reitit "0.5.5"] But if I put in my…
0
votes
1 answer

How do I edit Reitit routes in Reagent?

The routes created with the default reagent template look like this: ;; ------------------------- ;; Routes (def router (reitit/router [["/" :index] ["/items" ["" :items] ["/:item-id" :item]] ["/about" :about]])) If I change…
tltjr
  • 1,286
  • 1
  • 16
  • 14
-1
votes
2 answers

Address already in use when sending message to websocket

I’m using the manifold.stream library to send a message through a websocket: (defn send [] (manifold.stream/put! mysocket (generate-string {:type "unsubscribe" :product_ids ["ETH-USD"] :channels…
zendevil.eth
  • 974
  • 2
  • 9
  • 28
1
2