Skip to content

Interactive Development

weavejester edited this page Sep 17, 2014 · 25 revisions

There are two common ways of developing with Ring. The easier way is to use Lein-Ring. The more flexible way is to use the reloaded workflow.

Using Lein-Ring

The Lein-Ring plugin is the most straightforward way. To use it, first add it to your project file:

:plugins [[lein-ring "0.8.11"]]

You then need to tell it where your main handler function is. You can do this by adding the following option map to your project file:

:ring {:handler your.app/handler}

Once your project file is set up, you can use the following command to start a development server:

lein ring server

The server will automatically reload any modified files in your source directory.

Using the reloaded workflow

The reloaded workflow uses components that can be started or stopped, arranged together into a system. During development, the system is started in a running REPL, and when source files change, the system is shut down, the source files reloaded, and the system started once more.

Clone this wiki locally