Description
lite-server is a lightweight development server for web apps, distributed as an npm package. It serves a web app, opens it in the browser, refreshes the page when HTML or JavaScript changes, injects CSS changes over sockets, and shows a fallback page when a route is not found. That last feature is the reason it exists. In a single page app, a route such as /customer/21 is only known to the browser. If someone opens that link directly, a plain static server returns a 404, because the app has not loaded yet. lite-server returns index.html instead, so the app's own router can handle the route. It is a small wrapper around BrowserSync, which does the serving and reloading, with the fallback added as custom middleware. You can install it locally in your project and add a script entry to package.json, run it with npx, or install it globally. Configuration comes from a bs-config.json or bs-config.js file in your project, or from command line options such as --config and --baseDir. By default it serves the current folder, opens a browser, and falls back to index.html. The README says it is for development only.…
Highlights
- Serves a web app and opens it in the browser
- Reloads on HTML or JavaScript changes and injects CSS
- Falls back to index.html for single page app routes
- Configured with bs-config files or command line flags
- Built on BrowserSync, for development only
Ratings & Reviews
No ratings yet
Be the first to rate Lite Server.
People also visit
Lite Server FAQ
What is lite-server?
A lightweight development server for web apps that refreshes the browser on changes and handles single page app routes.
Can I use it in production?
No. The README describes it as a development only server.
Why does it return index.html?
So that client side routes, such as deep links to /customer/21, load the app instead of returning a 404 from the static server.
How do I install it?
Install it locally with npm and add a script to package.json, use npx, or install it globally.
How do I change the port or folder?
Use a bs-config.json or bs-config.js file, or the --baseDir and --config command line options.
Is it free?
Yes. It is open source and its code is on GitHub.
What are the best Lite Server alternatives?
Popular alternatives to Lite Server include Local Web Server, Static Web Server and Browser Run. See all Lite Server alternatives





