Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A concise routing library for Ring/Clojure
Clojure HTML

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/compojure
test
.gitignore
HISTORY.md
LICENSE.html
README.md
project.clj

README.md

Compojure is a small, open source web framework for the Clojure programming language.

An Example

Here's a small web application written using Compojure and Ring.

(ns hello-world
  (:use compojure.core, ring.adapter.jetty)
  (:require [compojure.route :as route]))

(defroutes main-routes
  (GET "/" [] "<h1>Hello World</h1>")
  (route/not-found "<h1>Page not found</h1>"))

(run-jetty main-routes {:port 8080})

Documentation

Breaking Changes

As of version 0.6.0, Compojure no longer adds default middleware to routes. This means you must explicitly add the wrap-params and wrap-cookies middleware to your routes.

To make this a little easier, the compojure.handler namespace provides functions that add common middleware functions to your routes.

Installing

The easiest way to use Compojure in your own projects is via Leiningen. Add the following dependency to your project.clj file:

[compojure "0.6.4"]

To build Compojure from source, run the following commands:

lein deps
lein jar

Mailing List

Compojure has a Google Group. This is the best place to ask questions and report bugs.

Something went wrong with that request. Please try again.