You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
  1. Fires up a simple, static web server on a given port. Use for local web development or file sharing (directory browsing enabled).
  2. Install
  3. -------
  4. Install [Node.js](http://nodejs.org), then run
  5. ```sh
  6. $ npm install -g local-web-server
  7. ```
  8. *Linux/Mac users may need to run the above with `sudo`*
  9. Usage
  10. -----
  11. From the folder you wish to serve, run:
  12. ```sh
  13. $ ws [--port|-p <port>] [--log-format|-p dev|default|short|tiny]
  14. ```
  15. The default port and log-format are 8000 and "dev", respectively.
  16. Use with Logstalgia
  17. ===================
  18. The "default" log-format is compatible with [logstalgia](http://code.google.com/p/logstalgia/).
  19. If you wrote your log output to disk, like so:
  20. ```sh
  21. $ ws --log-format default > web.log
  22. ```
  23. Then you could visualise in logstalgia with:
  24. ```sh
  25. $ logstalgia web.log
  26. ```
  27. Alternatively, pipe directly from ws into logstalgia for real-time visualisation:
  28. ```sh
  29. $ ws --log-format default | logstalgia -
  30. ```
  31. [![githalytics.com alpha](https://cruel-carlota.pagodabox.com/050b17b4263c08f12a2a9d9bbda80025 "githalytics.com")](http://githalytics.com/75lb/local-web-server)