Skip to content

Adds livereload functionality to express app to make development easier on express app without repetitive ⌘ + S

Notifications You must be signed in to change notification settings

mnmly/express-livereload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Livereload

This is really small plugin for express, which will run LiveReload server simultaniously for development.

Installation

npm install express-livereload

Usage

livereload = require('express-livereload')
app        = express()

livereload(app, config={})

Static helper

This plugin will attach LRScript which renders the snippet for loading livereload.js script.

layout.jade

doctype 5
html
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
    != LRScript

compiled.html

<!DOCTYPE html>
<html>
  <head>
    <title>Express</title>
    <link rel="stylesheet" href="/stylesheets/style.css">
    <script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js"></' + 'script>')</script>
  </head>
</html>

Config options

config objects can accept same options as node-livereload does, but with one extra key to specify which directry to watch out for.

config.watchDir = /path/to/dir or process.cwd() + "/public"

About

Adds livereload functionality to express app to make development easier on express app without repetitive ⌘ + S

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published