LinuxCommandLibrary

live-server

development server with live reload

TLDR

Start server in current directory

$ live-server
copy
Serve specific directory
$ live-server [public/]
copy
Custom port
$ live-server --port=[8080]
copy
Open specific file
$ live-server --open=[index.html]
copy
Watch specific files
$ live-server --watch=[src/,public/]
copy
Disable browser open
$ live-server --no-browser
copy

SYNOPSIS

live-server [options] [directory]

DESCRIPTION

live-server is a lightweight Node.js-based HTTP server designed for front-end development that automatically reloads the browser whenever files in the served directory change. It works by injecting a small script into HTML pages that opens a WebSocket connection back to the server, which triggers a page refresh when filesystem modifications are detected.
The server requires no configuration to get started and will serve the current directory by default, automatically opening your browser to the root page. You can customize the port, host binding, watched directories, and the initial page to open. Because it is intended strictly for development, it should not be used in production environments.

PARAMETERS

DIRECTORY

Directory to serve.
--port PORT
Server port number.
--host HOST
Host address to bind.
--open PATH
Path to open in browser.
--watch PATHS
Directories to watch for changes.
--no-browser
Don't open browser.
--help
Display help information.

CAVEATS

Node.js required. Development use only. Not for production.

HISTORY

live-server was created to simplify front-end development with automatic browser refresh on file changes.

SEE ALSO

http-server(1), serve(1), python(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community