Ring middleware to serve assets from WebJars
Clojure
Latest commit 1237bd7 Jul 25, 2015 @weavejester Release 0.1.1
Permalink
Failed to load latest commit information.
src/ring/middleware Add wrap-webjars middleware function Nov 28, 2014
test/ring/middleware Update dependencies Jul 24, 2015
.gitignore Initial commit Nov 28, 2014
.travis.yml Add Travis CI Nov 28, 2014
README.md Release 0.1.1 Jul 24, 2015
project.clj Release 0.1.1 Jul 24, 2015

README.md

Ring-WebJars

Build Status

Ring middleware to serve static assets from WebJars.

Installation

Include the following dependency in your project.clj file:

[ring-webjars "0.1.1"]

Usage

Require the middleware and add it to your handler.

(require '[ring.middleware.webjars :refer [wrap-webjars]])

(def app (wrap-webjars handler)

WebJar assets will then be served from the following path:

/assets/<webjar>/<asset path>

For example, if you include the [org.webjars/bootstrap "3.3.5"] dependency, then the minified bootstrap CSS will be available at:

/assets/bootstrap/css/bootstrap.min.css

By default assets are placed on the /assets path. You can change the path by specifying a second argument.

(def app (web-webjars handler "/webjars"))

License

Copyright © 2015 James Reeves

Released under the MIT license.