reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
johan 2020-04-23T01:03:45.160900Z

Does the repo include a spec for file param when using http-malli ?

ikitommi 2020-04-23T04:40:52.161Z

you can also use ds/opt if you use the data-spec syntax, see https://cljdoc.org/d/metosin/spec-tools/CURRENT/doc/data-specs

ikitommi 2020-04-23T04:41:30.161300Z

a doc PR would be awesome to have an example of optional parameter, in both ways. Would anyone have time for that?

đź‘Ť 1
ikitommi 2020-04-23T04:43:03.161500Z

yes, it should just work if you have the coercion configured on. examples have good starting point with the needed mw configuration (and to test stuff)

ikitommi 2020-04-23T04:49:39.166500Z

@alishermatkurbanov040 you can use it in either or both. you can also share the routing tables in cljc if that is useful.

đź‘Ť 1
ikitommi 2020-04-23T04:52:34.168900Z

I could try to polish out & push out code for a simple cqrs-style dispatcher that we have used for with clj+cljs apps - describe the actions as data and generate http and ws endpoints (at runtime) out of those. now that we can serialize the data models too with #malli, one can ship a lot of information from the backend to the frontend at runtime, enabling truly dynamic systems, and also without much code.

konrad szydlo 2020-04-23T11:53:40.171700Z

Hi all. Do you write functional tests for your reitit back-end apps?

jtth 2020-04-23T15:01:19.173600Z

Luminus uses reitit as the router, managed by mount. (see here under “organizing application routes”.) maybe this is because i don’t quite understand mount, but how would I go about simulating requests to the app like in the reitit documentation, where I’d do something like (app {:request-type :get …})

bartuka 2020-04-23T15:51:54.176Z

Hi @jtth, the mount usually handles the runtime of the app, therefore the definition of the app as in the docs still need to happen somewhere in the luminus code-base.

(defstate webserver
  :start (http/run-server #'app {:port 4000})
  :stop (webserver :timeout 100))
I dont know the codebase there, but something like this may be happening. You need to use this same app that mount is using to start the server.

bartuka 2020-04-23T15:54:45.177100Z

I don't remember if you even need to have the server running to do that.