Lightweight development only node server that serves a web app, opens it in the browser, refreshes when html or javascript change, injects CSS changes using sockets, and has a fallback page when a route is not found.
Serve from the current folder and open (browse to) the default file (usually index.html) in that folder.
lite-server
Serve from the current folder and open (browse to) the default file (usually index.html) in the src
folder.
lite-server --open src
lite-server --verbose
Sets the port to serve. Defaults to 3000.
lite-server --port 3000
Which folder to holds the index.html
. Defaults to ./
lite-server --open src
Array of file patterns to watch. Defaults to all html, css and js.
lite-server --files '/**/*.html' '/**/*.css' '/**/*.js'
Folder (or collection of folders) to serve. Defaults to ./
. Use this when you want to specify which folders you want to serve assets from.
lite-server --baseDir './'
or to serve from multiple folders
lite-server --baseDir ./src --baseDir ./
Optionally proxy a server for the /api
endpoint. Maps /api
requests to otherserver:otherport/api
.
lite-server --proxy http://something.local:8000/