Middleware in Ring

Middleware in ring is a way to modify the incoming requests or outgoing responses.

Middleware can also wrap handlers or other middleware, affecting their behaviour. For example the wrap-reload middleware enables live reloading by detecting file changes and reloading affected functions into their namespace, before the request is passed to the relevant handler function

Here is a list of middleware available in Ring itself:

ring/ring-core middleware includes:

ring/ring-devel middleware provides:

Leiningent Templates

Templates can be used to create a project with a given set of dependencies as well as Clojure code.

There is a compojure template that gives you a basic running web application. To use this template to create a new project use the following command, substituting your own project-name

lein new compojure project-name

This project contains ring and compojure. The dependency for ring is ring/site-defaults which includes some sensible default settings for your application, eg security settings such as anti-forgery.

See the definition of ring/site-defaults for further information.

results matching ""

    No results matching ""