gimm / gulp-live-server

serve your nodejs/static app live
148 stars 71 forks source link

gulp-live-server

status downloads tag license

A handy, light-weight server you're going to love.

Install

NPM

Usage

API

static([folder][, port])

Config new server using the default server script, to serve the given folder on the specified port.

new(script)

Config new server using the given script.

gls(args[, options][, livereload])

gls here is a reference of var gls = require('gulp-live-server'). It aims to assemble configuration for the server child process as well as the tiny-lr server. static and new are just shortcuts for this. Usually, static and new will serve you well, but you can get more customized server with gls.

start([execPath])

Spawn a new child process based on the configuration.

stop()

Stop the server.

notify([event])

Tell livereload.js to reload the changed resource(s)

livereload.js

gulp-live-server comes with tiny-lr built in, which works as a livereload server. livereload.js is served by tiny-lr, but in order to get it loaded with your page, you have 3 options( to inject <script src="https://github.com/gimm/gulp-live-server/raw/master//localhost:35729/livereload.js"></script> into your page):

Usually, if http://localhost:35729/livereload.js is accessible, then your livereload server is ok, if you don't have the script tag for livereload.js in you page, you've problem with either your chrome plugin or the connect-livereload middle-ware as mentioned above.

DEBUG

If you want more output, set the DEBUG environment variables to * or gulp-live-server.