All Projects → faustinoaq → kemal-watcher

faustinoaq / kemal-watcher

Licence: MIT license
Kemal plugin to watch files and live-reload the browser

Programming Languages

crystal
512 projects

Labels

Projects that are alternatives of or similar to kemal-watcher

kave
Kemal API Version Extension
Stars: ✭ 31 (+47.62%)
Mutual labels:  kemal
kemal-rest-api
Crystal library to create REST API with Kemal
Stars: ✭ 56 (+166.67%)
Mutual labels:  kemal
kemal-vue-chat
this is experimental repo for Kemal and Vue.js (+ WebSocket)
Stars: ✭ 32 (+52.38%)
Mutual labels:  kemal
spec-kemal
Easy testing for Kemal
Stars: ✭ 51 (+142.86%)
Mutual labels:  kemal
Kemal
Fast, Effective, Simple Web Framework
Stars: ✭ 3,227 (+15266.67%)
Mutual labels:  kemal
kemal-session
Simple session handler for Kemal
Stars: ✭ 47 (+123.81%)
Mutual labels:  kemal
crystular
Crystal regex tester http://www.crystular.org/
Stars: ✭ 31 (+47.62%)
Mutual labels:  kemal
kemal-basic-auth
Basic auth for your Kemal application
Stars: ✭ 14 (-33.33%)
Mutual labels:  kemal

kemal-watcher

Build Status

Kemal plugin to watch files like client stuff.

Installation

Add this to your application's shard.yml:

dependencies:
  kemal-watcher:
    github: faustinoaq/kemal-watcher

Usage

Add Kemal.watch to your Kemal app to watch files.

require "kemal"
require "kemal-watcher"

get "/" do
  File.read "src/views/index.html"
end

files = [
  "public/*.js",
  "public/*.html"
]

Kemal.watch(files)
Kemal.run

How does it works?

Kemal.watch uses watcher to watch files and add a new handler to Kemal that inject a script in the response. When a change is detected an event handler is executed and then send a reload signal to the clients.

Contributing

  1. Fork it ( https://github.com/faustinoaq/kemal-watcher/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Disclaimer

Kemal.watch is intended for use in a development environment.

Contributors

  • faustinoaq Faustino Aguilar - creator, maintainer
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].