|
@ -5,7 +5,7 @@ |
|
|
|
|
|
|
|
|
local-web-server |
|
|
local-web-server |
|
|
================ |
|
|
================ |
|
|
Fires up a simple, static web server on a given port. Use for local web development or file sharing (directory browsing enabled). |
|
|
|
|
|
|
|
|
Fires up a simple, CORS-enabled, static web server on a given port. Use for local web development or file sharing (directory browsing enabled). |
|
|
|
|
|
|
|
|
![local-web-server](http://75lb.github.io/local-web-server/ws.gif) |
|
|
![local-web-server](http://75lb.github.io/local-web-server/ws.gif) |
|
|
|
|
|
|
|
@ -13,23 +13,26 @@ Install |
|
|
------- |
|
|
------- |
|
|
Ensure [node.js](http://nodejs.org) is installed first. Linux/Mac users may need to run the following commands with `sudo`. |
|
|
Ensure [node.js](http://nodejs.org) is installed first. Linux/Mac users may need to run the following commands with `sudo`. |
|
|
|
|
|
|
|
|
##As a global command |
|
|
|
|
|
|
|
|
##Globally |
|
|
```sh |
|
|
```sh |
|
|
$ npm install -g local-web-server |
|
|
$ npm install -g local-web-server |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
##As a server deployed with your project |
|
|
|
|
|
|
|
|
##Deployed with your project |
|
|
```sh |
|
|
```sh |
|
|
$ npm install local-web-server --save-dev |
|
|
$ npm install local-web-server --save-dev |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
Then add an `npm start` script to your `package.json`, the standard npm approach: |
|
|
|
|
|
|
|
|
Then add an `start` script to your `package.json` (the standard npm approach): |
|
|
```json |
|
|
```json |
|
|
|
|
|
{ |
|
|
|
|
|
"name": "my-web-app", |
|
|
|
|
|
"version": "1.0.0", |
|
|
"scripts": { |
|
|
"scripts": { |
|
|
"start": "ws" |
|
|
"start": "ws" |
|
|
} |
|
|
} |
|
|
``` |
|
|
``` |
|
|
This simplifies a set of rather specific looking install instructions like: |
|
|
|
|
|
|
|
|
This simplifies a rather specific looking instruction set like: |
|
|
|
|
|
|
|
|
```sh |
|
|
```sh |
|
|
$ npm install |
|
|
$ npm install |
|
|