Description
local-web-server is a lean, modular web server for full-stack development. It is a distribution of the lws toolkit, bundled with a starter pack of middleware, and it installs the ws command-line tool. It can host a folder as a static website, showing a directory listing or your index.html. It can serve a single page application by marking index.html as the app, so client-side routes like /login fall back to the app while real static files are served directly. It can rewrite URLs and proxy certain paths to a remote server, such as forwarding requests under /posts/ to another API, and it can set a default file extension. It supports HTTP, HTTPS and HTTP/2, with flags to turn on the last two, and the project's wiki explains how to get a trusted certificate in the browser. A verbose mode and log formats such as dev and stats help you monitor activity, and a custom view can change how activity is shown. The server has programmatic and command-line interfaces. Developers use it to build static, dynamic and single page front ends, to prototype REST, microservice, WebSocket and Server-Sent Events back ends, and to test caching strategies. It is aimed at developers who want a small local server they can tune rather than a large framework.…
Highlights
- Static site hosting with directory listings
- Single page application fallback routing
- URL rewriting and proxied requests
- HTTP, HTTPS and HTTP/2 support
- Modular middleware and a programmatic API
Ratings & Reviews
No ratings yet
Be the first to rate Local Web Server.
People also visit
hostc
Localhost, anywhere. One command gives your dev server a public HTTPS URL
Local Web Server FAQ
What is local-web-server?
A lean, modular web server for local full-stack development, distributed as the ws command-line tool.
How do I serve a folder?
Run ws with no arguments in the folder, and it hosts the current directory as a static website.
How do I serve a single page app?
Specify your single page as the SPA entry, so requests for static files are served and other routes fall back to the app.
Can it proxy requests to another server?
Yes. The README shows forwarding paths that begin with /posts/ to a remote API, with rewrite options.
Does it support HTTPS?
Yes. Pass --https for HTTPS, or --http2 for HTTP/2. The wiki covers trusted certificates.
Is it open source?
Yes. The source is on GitHub under the lwsjs organization.
What are the best Local Web Server alternatives?
Popular alternatives to Local Web Server include Static Web Server, hostc and Lite Server. See all Local Web Server alternatives


