Compojure Documentation

repository·master·Indexed 26 days ago

https://github.com/weavejester/compojure

A lightweight routing library for the Ring web server interface in Clojure that allows developers to build web applications by composing small, independent, and modular routing parts.

Tokens
185
Snippets
1
Records
2
Agent score
38%

What's inside Compojure

  1. Basic Usage of Compojure routes

    master

    Compojure allows you to define a Ring handler by composing routes using defroutes. You can use compojure.core for standard routing and compojure.route for special routes like not-found.

    (ns hello-world.core
      (:require [compojure.core :refer :all]
                [compojure.route :as route]))
    
    (defroutes app
      (GET "/" [] "<h1>Hello World</h1>")
      (route/not-found "<h1>Page not found</h1>"))