This commit is contained in:
Lloyd Brookes
2016-06-20 20:32:32 +01:00
parent ef9bbf8066
commit 22612bbcf4
34 changed files with 59 additions and 88 deletions

View File

@ -8,28 +8,40 @@
***Requires node v4.0.0 or higher. Install the [previous release](https://github.com/75lb/local-web-server/tree/prev) for older node support.***
# local-web-server
A simple web-server for productive front-end development. Typical use cases:
An application shell for building a simple, command-line web server for productive web development.
* Front-end Development
* Static or Single Page App development
* Re-route paths to local or remote resources
* Efficient, predictable, entity-tag-powered conditional request handling (no need to 'Disable Cache' in DevTools, slowing page-load down)
It is trivial is bundle and deploy with your project. Also deploys to heroku well for demo projects.
It comes with some middleware built-in, which you need not use but will get you up and running for the following use cases:
* Static or Single Page Application front-end development where you have
* No backend, an existing remote API or need to mock-up an API.
Application Shell
* HTTP or HTTPS server
* HTTPS is strictly required by some modern techs (ServiceWorker, Media Capture and Streams etc.)
* Add your middleware
* Use any combination of built-in and custom middleware
* specify options (for command line or config)
* Accepts Koa v1 or 2 middleware
* Bundle with your front-end project
* Very little configuration, just a few options
* Configuration is via json file or command-line (latter taking presedence)
* Outputs a dynamic statistics view to the terminal
Built-in Middleware (all optional)
* Rewrite routes to local or remote resources
* Efficient, predictable, entity-tag-powered conditional request handling (no need to 'Disable Cache' in DevTools, slowing page-load down)
* Configurable log output, compatible with [Goaccess, Logstalgia and glTail](https://github.com/75lb/local-web-server/blob/master/doc/visualisation.md)
* Back-end service mocking
* Prototype a web service, microservice, REST API etc.
* Mocks are defined with config (static), or code (dynamic).
* Proxy server
* Map local routes to remote servers. Removes CORS pain when consuming remote services.
* Back-end service mocking
* Prototype a web service, microservice, REST API etc.
* Mocks are defined with config (static), or code (dynamic).
* CORS-friendly, all origins allowed by default.
* Proxy server
* Map local routes to remote servers. Removes CORS pain when consuming remote services.
* HTTPS server
* HTTPS is strictly required by some modern techs (ServiceWorker, Media Capture and Streams etc.)
* File sharing
## Synopsis
local-web-server is a simple command-line tool. To use it, from your project directory run `ws`.
local-web-server is a command-line tool. To serve the current directory, run `ws`.
<pre><code>$ ws --help