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.

57 lines
1.6 KiB

11 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
12 years ago
11 years ago
11 years ago
  1. [![NPM version](https://badge.fury.io/js/local-web-server.png)](http://badge.fury.io/js/local-web-server)
  2. local-web-server
  3. ================
  4. Fires up a simple, static web server on a given port. Use for local web development or file sharing (directory browsing enabled).
  5. Install
  6. -------
  7. Install [Node.js](http://nodejs.org), then run
  8. ```sh
  9. $ npm install -g local-web-server
  10. ```
  11. *Linux/Mac users may need to run the above with `sudo`*
  12. Usage
  13. -----
  14. From the folder you wish to serve, run:
  15. ```sh
  16. $ ws
  17. serving at http://localhost:8000
  18. ```
  19. If you wish to override the default port (8000), use `--port` or `-p`:
  20. ```sh
  21. $ ws --port 9000
  22. serving at http://localhost:9000
  23. ```
  24. Use a built-in or custom [Connect logger format](http://www.senchalabs.org/connect/middleware-logger.html) with `--log-format`:
  25. ```sh
  26. $ ws --log-format short
  27. ```
  28. Use with Logstalgia
  29. -------------------
  30. The "default" log-format is compatible with [logstalgia](http://code.google.com/p/logstalgia/).
  31. If you wrote your log output to disk, like so:
  32. ```sh
  33. $ ws --log-format default > web.log
  34. ```
  35. Then you could visualise in logstalgia with:
  36. ```sh
  37. $ logstalgia web.log
  38. ```
  39. Alternatively, pipe directly from ws into logstalgia for real-time visualisation:
  40. ```sh
  41. $ ws --log-format default | logstalgia -
  42. ```
  43. [![githalytics.com alpha](https://cruel-carlota.pagodabox.com/050b17b4263c08f12a2a9d9bbda80025 "githalytics.com")](http://githalytics.com/75lb/local-web-server)
  44. [![NPM](https://nodei.co/npm-dl/local-web-server.png?months=1)](https://nodei.co/npm/local-web-server/)
  45. [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/75lb/local-web-server/trend.png)](https://bitdeli.com/free "Bitdeli Badge")