Creating Application Templates

Once we create a particular type of application, such as our picture-gallery app, we may want to write other similar applications that use the same structure. It would be nice to be able to create a skeleton application template that could be used for this task. This is precisely what we can do by creating Leiningen templates.

Throughout this book we’ve been using the compojure-app template when we created new projects. Here we’ll cover how this template works and how to make templates of our own.[64]

Leiningen uses the lein-newnew plug-in for template creation. To create a new template we merely have to run lein new template <template name>.[65]

Let’s look inside the compojure-app template project to see ...

Get Web Development with Clojure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.