Skip to content
This repository

A concise routing library for Ring/Clojure

Fetching latest commit…

Cannot retrieve the latest commit at this time

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, Ring and Hiccup.

(ns hello-world
  (:use [compojure.core :only (defroutes GET ANY)]
        [hiccup.core :only (html)]
        [ring.adapter.jetty :only (run-jetty)]
        [ring.util.response :only (redirect)])

(defroutes main-routes
  (GET "/" []
    (redirect "/world"))
  (GET "/:name" [name]
    (html [:h1 "Hello " name]))
  (ANY "*" {uri :uri}
    {:status 404
     :body (html [:h1 "Page not found: " uri])}))

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

Community

The Compojure Google Group is the best place to ask questions about Compojure, suggest improvements or to reportbugs.

Something went wrong with that request. Please try again.