-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conflicted with ring.middleware.format.wrap-restful-format #123
Comments
Hi @pkvov, you'll need to adjust your routing so that you're not applying unnecessary/incompatible middleware to Sente's routes (usu. one "/chsk" GET and one POST). Does that help / make sense? |
thanks @ptaoussanis . |
The "/chsk" routes are basically an implementation detail as used by Sente. You shouldn't be applying application-level middleware to them, does that make sense?
Sure, you can continue to use any middleware you want (incl. The "/chsk" routes need Your own routes can have any middleware you like. Does that make sense? You can exclude application-level middleware from Sente in several ways, the quickest/easiest might be something like |
thanks alot @ptaoussanis , i finally understand. do not mix Sente routes and middleware with application routes and middleware. |
No problem, happy you found a solution. Thanks for sharing the link, that'll be helpful for other folks that might run into this issue. Cheers :-) |
- Endpoints can specify middleware - Routes will be recombined according to their middleware - The Handler component can also specify middleware that will be applied to all endpoints/routes This allows to address the use case when different routes need different middleware. For example, Sente is incompatible with `wrap-restful-format'. taoensso/sente#123 Decomplecting routes and middleware also enables better composition. Side-effectful middleware, such as wrap-params, consumes the request body upon reading it. This means it should only be applied once. Hence, web-centric libraries should never force such middleware on the user, but rather let him apply any middleware needed on recombined routes in the end application. ring-clojure/ring-defaults#10 With our new implementation, it is possible to write libraries, for example a social sign-in library, keep it totally separate from application code, and then, with the Duct abstractions in `system', compose endpoints with any middleware the application should need.
- Endpoints can specify middleware - Routes will be recombined according to their middleware - The Handler component can also specify middleware that will be applied to all endpoints/routes This allows to address the use case when different routes need different middleware. For example, Sente is incompatible with `wrap-restful-format'. taoensso/sente#123 Decomplecting routes and middleware also enables better composition. Side-effectful middleware, such as wrap-params, consumes the request body upon reading it. This means it should only be applied once. Hence, web-centric libraries should never force such middleware on the user, but rather let him apply any middleware needed on recombined routes in the end application. ring-clojure/ring-defaults#10 With our new implementation, it is possible to write libraries, for example a social sign-in library, keep it totally separate from application code, and then, with the Duct abstractions in `system', compose endpoints with any middleware the application should need.
i found it conflicted with ring.middleware.format.wrap-restful-format.
thanks && appreciate your wonderful library
here is my ring handler
The text was updated successfully, but these errors were encountered: