A fast data-driven routing library for Clojure/Script
Find a file
2017-12-26 22:41:17 +02:00
.circleci Oh, we have circeci too 2017-10-29 09:31:28 +02:00
dev-resources Middleware & Interceptor perf tests 2017-12-17 21:24:21 +02:00
doc . 2017-12-16 10:51:32 +02:00
examples Update docs 2017-12-09 23:21:03 +02:00
modules Support ring-route-data validation 2017-12-26 22:41:17 +02:00
perf-test/clj/reitit Middleware & Interceptor perf tests 2017-12-17 21:24:21 +02:00
scripts initial commit 2017-11-24 19:09:45 +02:00
test Support ring-route-data validation 2017-12-26 22:41:17 +02:00
.gitignore Add karma packages 2017-10-25 17:32:12 +03:00
.travis.yml Try to fix .travis conf 2017-10-29 09:31:28 +02:00
book.json Explicitly use the highlight plugin for gitbook 2017-09-14 17:39:26 +03:00
CHANGELOG.md Initial commit 2017-08-07 14:15:45 +03:00
CONTRIBUTING.md Initial commit 2017-08-07 14:15:45 +03:00
LICENSE Initial commit 2017-08-07 14:15:45 +03:00
package-lock.json Add karma packages 2017-10-25 17:32:12 +03:00
package.json Add karma packages 2017-10-25 17:32:12 +03:00
project.clj Update expound 2017-12-26 17:43:51 +02:00
README.md docs 2017-12-12 22:40:42 +02:00

reitit Build Status Clojars Project

A friendly data-driven router for Clojure(Script).

See the full documentation for details.

Latest version

All bundled:

[metosin/reitit "0.1.0-SNAPSHOT"]

Optionally, the parts can be required separately:

[metosin/reitit-core "0.1.0-SNAPSHOT"] ; just the router
[metosin/reitit-ring "0.1.0-SNAPSHOT"] ; ring-router
[metosin/reitit-spec "0.1.0-SNAPSHOT"] ; spec coercion
[metosin/reitit-schema "0.1.0-SNAPSHOT"] ; schema coercion

Quick start

(require '[reitit.core :as r])

(def router
  (r/router
    [["/api/ping" ::ping]
     ["/api/orders/:id" ::order]]))

(r/match-by-path router "/api/ping")
; #Match{:template "/api/ping"
;        :data {:name ::ping}
;        :result nil
;        :params {}
;        :path "/api/ping"}

(r/match-by-name router ::order {:id 2})
; #Match{:template "/api/orders/:id",
;        :data {:name ::order},
;        :result nil,
;        :params {:id 2},
;        :path "/api/orders/2"}

More info

Check out the full documentation!

Roadmap is mostly written in issues.

There is also a #reitit channel in Clojurians slack.

Special thanks

To all Clojure(Script) routing libs out there, expecially to Ataraxy, Bide, Bidi, Compojure and Pedestal.

Also to Compojure-api, Kekkonen, Ring-swagger and Yada and for ideas, coercion & stuff.

And, of course, to: Schema and clojure.spec.

Development instructions

The documentation is built with gitbook. To preview your changes locally:

npm install -g gitbook-cli
gitbook install
gitbook serve

To bump up version:

# new version
./scripts/set-version "1.0.0"
./scripts/lein-modules install

# works
lein test

# deploy to clojars
./scripts/lein-modules do clean, deploy clojars

License

Copyright © 2017 Metosin Oy

Distributed under the Eclipse Public License, the same as Clojure.