Does the repo include a spec for file param when using http-malli ?
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
a doc PR would be awesome to have an example of optional parameter, in both ways. Would anyone have time for that?
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)
@johan178 maybe here? https://github.com/metosin/reitit/blob/master/modules/reitit-interceptors/src/reitit/http/interceptors/multipart.clj
@alishermatkurbanov040 you can use it in either or both. you can also share the routing tables in cljc
if that is useful.
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.
Hi all. Do you write functional tests for your reitit back-end apps?
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 …})
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.I don't remember if you even need to have the server running to do that.