• Stars
    star
    20
  • Rank 1,121,974 (Top 23 %)
  • Language
    Crystal
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kemal plugin to watch files and live-reload the browser

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

More Repositories

1

crystal-windows-installer

Installer for Crystal on Bash on Windows
Inno Setup
37
star
2

sswws

Super Simple Windows Web Server
Crystal
31
star
3

ruby2crystal

A proof of concept tool to help porting gems to shards
Crystal
29
star
4

watcher

Crystal shard to watch file changes using File.stat
Crystal
21
star
5

vscode-lex-flex-yacc-bison

Syntax highlighting for Lex, Flex, Yacc and Bison in VSCode.
20
star
6

secrets

Useful to get input on noecho, secrets, passwords, token, hints
Crystal
12
star
7

sentry-run

Use Sentry shard for reload your app
Crystal
11
star
8

vscode-javac-linter

A Java linter for Visual Studio Code
TypeScript
10
star
9

interactive-crystal

Experiment with dynamic library loading
Crystal
8
star
10

vscode-mint-lang

VSCode extension for Mint Programming Language
6
star
11

ambrockets

Simple Websockets example using Amber
JavaScript
6
star
12

crystal-broadlink

Crystal shard for Broadlink IR controllers like remote controls, sensor platforms and smart plugs 📡
Crystal
4
star
13

pet-tracker

Amber Framework demo for Quick Start guide
Crystal
4
star
14

round-robin

Algoritmo de planificación por turnos (Round Robin)
Java
3
star
15

coscan

A project for scaning target sub-networks
Crystal
2
star
16

vector-matrix

Simulate matrix using vectors
Crystal
1
star
17

repo-intro-react-hls

JavaScript
1
star
18

amber-aur

AUR repository for Amber
Shell
1
star
19

kemal-reuse-port

A kemal app using reuse port
Crystal
1
star
20

vue-amber-recipe

An Amber Framework recipe using Vue.js
Crystal
1
star
21

huffman

An implementation of Huffman algorithm in Crystal for learning purposes
Crystal
1
star
22

macOS.qcow2

macOS VM in KVM with RX550 GPU passthrough
1
star
23

arreglos-c

Prácticas de arreglos en C
C
1
star