Examples
Last updated
Hello World Hello World with ring.util.response Form parameters Sessions
Parameter Middleware
Last updated
URL-Encoded Parameters The [[ring.middleware.params/wrap-params|http://mmcgrana.github.com/ring/middleware.params-api.html#ring.middleware.params/wrap-params]] middleware function adds support for url-encoded ...
Middleware Patterns
Last updated
Adding keys to the request map Keys can be added to the request map to pass additonal information to the handler and other middleware. Here is an example that adds a :user key to the request, if there ...
Standard middleware
Last updated
Here is a list of middlewares available in Ring itself: In ring/ring-core : wrap-cookies (ring.middleware.cookies) wrap-file (ring.middleware.file) wrap-file-info (ring.middleware.file-info) wrap-flash ...
Standard Library
Last updated
Responses The ring.util.response namespace contains functions for generating responses. This can make your handlers more concise and understandable. In the last section the following example was used: ...
Concepts
Last updated
A web application developed for Ring consists of four components: Handler Request Response Middleware Handlers Handlers are functions that define your web application. They take one argument, a map representing ...
Cookies
Last updated
To add cookie support to your Ring handler, you'll need to wrap it in the wrap-cookies middleware: ( use 'ring.middleware.cookies) ( def app ( wrap-cookies your-handler)) This adds the :cookies ...
File Uploads
Last updated
Uploading a file to a website requires multipart form handling, which Ring provides with its wrap-multipart-params middleware. ( use 'ring.middleware.params 'ring.middleware.multipart-params) ...
Why Use Ring?
Last updated
Using Ring as the basis for your web application has a number of benefits: Write your application using Clojure functions and maps Run your application in a auto-reloading development server Compile your ...
Static Resources
Last updated
Web applications often need to serve static content, such as images or stylesheets. Ring provides two middleware functions to do this. One is wrap-file . This serves static content from a directory on ...