Skip to content

A Clojure middleware library for Ring that automatically triggers a browser refresh

Notifications You must be signed in to change notification settings

weavejester/ring-refresh

Repository files navigation

Ring-Refresh Build Status

Ring-Refresh is a middleware library for Ring that automatically triggers a browser refresh when your source files change.

It achieves this by injecting a small Javascript script into any HTML response triggered by a GET route.

This library is designed for use only in development environments.

Installation

Add the following development dependency to your project.clj file:

[ring-refresh "0.2.0"]

Usage

By default, the middleware monitors the src and resources directories:

(use 'ring.middleware.refresh)

(def app
  (wrap-refresh your-handler))

But it can be customized to include other directories:

(def app
  (wrap-refresh
   your-handler
   ["src" "resources" "checkouts/foo/src"]))

License

Copyright © 2024 James Reeves

Distributed under the Eclipse Public License, the same as Clojure.

About

A Clojure middleware library for Ring that automatically triggers a browser refresh

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •