diff --git a/advanced/composing_routers.html b/advanced/composing_routers.html
index 9ba0e6b6..da489a6b 100644
--- a/advanced/composing_routers.html
+++ b/advanced/composing_routers.html
@@ -1124,7 +1124,7 @@
diff --git a/advanced/configuring_routers.html b/advanced/configuring_routers.html
index 9ffbd823..adef4abd 100644
--- a/advanced/configuring_routers.html
+++ b/advanced/configuring_routers.html
@@ -830,7 +830,7 @@
diff --git a/advanced/dev_workflow.html b/advanced/dev_workflow.html
index 296af1f6..1d7f4775 100644
--- a/advanced/dev_workflow.html
+++ b/advanced/dev_workflow.html
@@ -889,7 +889,7 @@
diff --git a/advanced/different_routers.html b/advanced/different_routers.html
index c0016d05..655bde12 100644
--- a/advanced/different_routers.html
+++ b/advanced/different_routers.html
@@ -837,7 +837,7 @@
diff --git a/advanced/route_validation.html b/advanced/route_validation.html
index be238d41..2ea14ccc 100644
--- a/advanced/route_validation.html
+++ b/advanced/route_validation.html
@@ -925,7 +925,7 @@
diff --git a/advanced/shared_routes.html b/advanced/shared_routes.html
index 545bd06a..e2d60c3f 100644
--- a/advanced/shared_routes.html
+++ b/advanced/shared_routes.html
@@ -845,7 +845,7 @@
diff --git a/basics/name_based_routing.html b/basics/name_based_routing.html
index 624b8398..e4f259a5 100644
--- a/basics/name_based_routing.html
+++ b/basics/name_based_routing.html
@@ -848,7 +848,7 @@
diff --git a/basics/path_based_routing.html b/basics/path_based_routing.html
index 858b56a8..b60396b4 100644
--- a/basics/path_based_routing.html
+++ b/basics/path_based_routing.html
@@ -806,7 +806,7 @@
diff --git a/basics/route_conflicts.html b/basics/route_conflicts.html
index a49cb5cb..ad19a769 100644
--- a/basics/route_conflicts.html
+++ b/basics/route_conflicts.html
@@ -849,7 +849,7 @@
diff --git a/basics/route_data.html b/basics/route_data.html
index 5aa9722e..fd68b434 100644
--- a/basics/route_data.html
+++ b/basics/route_data.html
@@ -847,7 +847,7 @@
diff --git a/basics/route_data_validation.html b/basics/route_data_validation.html
index 1b7dfc1c..c6c15560 100644
--- a/basics/route_data_validation.html
+++ b/basics/route_data_validation.html
@@ -899,7 +899,7 @@
diff --git a/basics/route_syntax.html b/basics/route_syntax.html
index 877351ce..7e1ee0c9 100644
--- a/basics/route_syntax.html
+++ b/basics/route_syntax.html
@@ -836,7 +836,7 @@ E.g., /foo bar should be /foo%20bar.
Pedestal is a well known interceptor-based web framework for Clojure. To use reitit-http with Pedestal, we need to change the default routing interceptor. The needed helpers for this are found in a separate package:
[metosin/reitit-ring "0.2.9"]
+Pedestal is a backend web framework for Clojure. reitit-pedestal provides an alternative routing engine for Pedestal.
+[metosin/reitit-pedestal "0.2.9"]
-You should read the interceptor guide to understand the basics on Interceptor-based dispatch.
+Why should one use reitit instead of the Pedestal default routing?
+
+- One simple route syntax, with full route conflict resolution.
+- Supports first class route data with spec validation.
+- Fixes some known problems in routing.
+- Can handle trailing backslashes.
+- One router for both backend and frontend.
+- Supports parameter coercion & Swagger.
+- Is even faster.
+
+To use Pedestal with reitit, you should first read both the Pedestal docs and the reitit interceptor guide.
Example
A minimalistic example on how to to swap the default-router with a reitit router.
; [io.pedestal/pedestal.service "0.5.5"]
@@ -753,39 +763,32 @@
[reitit.http :as http]
[reitit.ring :as ring]))
-(def router
- (pedestal/routing-interceptor
- (http/router
- ["/ping" (fn [_] {:status 200, :body "pong"})])
- (ring/create-default-handler)))
+(def routes
+ ["/ping" {:get (fn [_] {:status 200, :body "pong"})}])
-(defn start []
- (-> {::server/type :jetty
- ::server/port 3000
- ::server/join? false
- ;; no pedestal routes
- ::server/routes []}
- (server/default-interceptors)
- ;; swap the reitit router
- (pedestal/replace-last-interceptor router)
- (server/dev-interceptors)
- (server/create-server)
- (server/start))
- (println "server running in port 3000"))
-
-(start)
+(-> {::server/type :jetty
+ ::server/port 3000
+ ::server/join? false
+ ;; no pedestal routes
+ ::server/routes []}
+ (server/default-interceptors)
+ ;; swap the reitit router
+ (pedestal/replace-last-interceptor
+ (pedestal/routing-interceptor
+ (http/router routes)))
+ (server/dev-interceptors)
+ (server/create-server)
+ (server/start))
-Caveat
-There is no common interceptor spec for Clojure and All default reitit interceptors (coercion, exceptions etc.) use the Sieppari interceptor model. For most parts, they are fully compatible with the Pedestal Interceptor model. Only exception being that the :error handlers take just 1 arity (context) compared to Pedestal's 2-arity (context and exception).
-Currently, there is only the reitit.http.interceptors.exception/exception-interceptor which has :error defined - just don't use it and everything should just work.
-You are most welcome to discuss about a common interceptor spec in #interceptors in Clojurians Slack.
-See the error handling guide on how to handle errors with Pedestal.
+Compatibility
+There is no common interceptor spec for Clojure and all default reitit interceptors (coercion, exceptions etc.) use the Sieppari interceptor model. It is mostly compatible with the Pedestal Interceptor model, only exception being that the :error handlers take just 1 arity (context) compared to Pedestal's 2-arity (context and exception).
+Currently, out of the reitit default interceptors, there is only the reitit.http.interceptors.exception/exception-interceptor which has the :error defined.
+You are most welcome to discuss about a common interceptor spec in #interceptors on Clojurians Slack.
More examples
Simple
-Simple example, with both sync & async interceptors: https://github.com/metosin/reitit/tree/master/examples/pedestal
+Simple example with sync & async interceptors: https://github.com/metosin/reitit/tree/master/examples/pedestal
Swagger
-More complete example with custom interceptors, default interceptors, coercion and swagger-support: https://github.com/metosin/reitit/tree/master/examples/pedestal-swagger
-note: exception handling is disabled in this example
+More complete example with custom interceptors, default interceptors, coercion and swagger-support enabled: https://github.com/metosin/reitit/tree/master/examples/pedestal-swagger