Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 2d56ecebb6
Fetching contributors…

Cannot retrieve contributors at this time

98 lines (59 sloc) 3.39 KB

What is Route One

Route One is a tiny Clojure library that generates HTTP resource routes (as in Ruby on Rails, Jersey, Noir and similar modern Web application frameworks). It is meant to be used in HTTP clients, programs that deliver emails with links, testing environments and so on.

Route One is intentionally small and has very limited feature scope.

Documentation & Examples

  (:use [clojurewerkz.route-one.core :only [route-map route path-for named-path]]))

;; define a route map
  (route "/about" :named "about page")
  (route "/faq")
  (route "/help"  :named "help page")
  (route "/docs/:title" :named "documents"))

;; generate relative paths
(path-for "/docs/title"  { :title "ohai" }) ;; => "/docs/title"
(path-for "/docs/:title" { :title "ohai" }) ;; => "/docs/ohai"
(path-for "/docs/:category/:title" { :category "greetings" :title "ohai" }) ;; => "/docs/greetings/ohai"
(path-for "/docs/:category/:title" { :category "greetings" }) ;; => IllegalArgumentException, because :title value is missing

(named-path "about page") ;; => "/about"
(named-path "documents" {:title "a-title"}) ;; => "/docs/a-title"

(with-base-url ""
  (url-for "/docs/title"  { :title "ohai" }) ;; => ""
  (url-for "/docs/:title" { :title "ohai" }) ;; => ""
  (url-for "/docs/:category/:title" { :category "greetings" :title "ohai" }) ;; => ""
  (url-for "/docs/:category/:title" { :category "greetings" }) ;; => IllegalArgumentException, because :title value is missing

  (named-url "about page") ;; => ""
  (named-url "documents" {:title "a-title"}) ;; => ""

Documentation site for Urly is coming in the future (sorry!). Please see our test suite for more code examples.

Maven Artifacts

The Most Recent Release

With Leiningen:

[clojurewerkz/route-one "1.0.0-beta1"]

With Maven:


Supported Clojure versions

Route One is built from the ground up for Clojure 1.3+ and JDK 6+.

Route One Is a ClojureWerkz Project

Route One is part of the group of libraries known as ClojureWerkz, together with Neocons, Monger, Langohr, Elastisch, Quartzite, Urly and several others.

Continuous Integration

Continuous Integration status

CI is hosted by


Route One uses Leiningen 2. Make sure you have it installed and then run tests against all supported Clojure versions using

lein2 all test

Then create a branch and make your changes on it. Once you are done with your changes and all tests pass, submit a pull request on Github.


Copyright © 2012 Michael S. Klishin, Alex Petrov

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

Jump to Line
Something went wrong with that request. Please try again.