Comments (7)
Fonecta!
from reitit.
Could you provide an example when this happens?
from reitit.
When the route is not found:
(require '[reitit.ring :as ring])
(defn handler [_ respond raise] (respond {:status 200, :body "ok"}))
(def app (ring/ring-handler (ring/router ["/ping" handler])))
(app {:request-method :get, :uri "/pong"} #(prn :RESPOND %) #(prn :RAISE %))
;; => nil, nothing happens
If the handler would be falsy, that would would be a problem as well, but ensure-handler!
prevents this.
This is one of the cases where I'd prefer when
over single-branch if
. when
in the final/tail position of a continuation-passing style function is always wrong. Thus it'd be obvious at glance that the async handler is flawed if it was written with when
.
from reitit.
Good points. Should be fixed now?
from reitit.
SNAPSHOTs updated in Clojars.
from reitit.
It's better now! I added some comments to the commit.
from reitit.
autocomplete ftw :))
from reitit.
Related Issues (20)
- Muuntaja – OpenAPI integration HOT 1
- Generate swagger top-level definitions for spec & schema
- Malli -> Openapi fails with custom registries HOT 1
- Consider supporting defmulti as handler
- Example projects using reitit.swagger fail to compile
- The server is starting fine but the Swagger UI in the frontend is flashing an error HOT 1
- How about supporting uppercased route HTTP in Ring handler method keywords? HOT 2
- Is it possible to do multi host with reitit-routes? HOT 2
- New version of `@seriousme/openapi-schema-validator` finds new errors HOT 1
- `reitit.coercion.malli` - invalid keys for :responses are accepted
- [Bug] Can't generate swagger with var references HOT 2
- Improve reitit malli humanize data so you can map the errors back to the submitted data.
- Drop Java 8 support
- Resource handler: serve index file without a redirect
- Route data maps ignore meta-merge options in 0.7.0, breaking compatibility HOT 3
- reitit.pedestal/replace-last-interceptor does not replace pedestal router
- Route data validation using malli HOT 1
- Body parameters are always an array HOT 2
- Clojure record in route data is converted to a plain map
- `print-request-diffs` doesn't respect bindings HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reitit.