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.

51 lines
1.3 KiB

11 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
11 years ago
12 years ago
11 years ago
12 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 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
  14. serving at http://localhost:8000
  15. ```
  16. If you wish to override the default port (8000), use `--port` or `-p`:
  17. ```sh
  18. $ ws --port 9000
  19. serving at http://localhost:9000
  20. ```
  21. Use a built-in or custom [Connect logger format](http://www.senchalabs.org/connect/middleware-logger.html) with `--log-format`:
  22. ```sh
  23. $ ws --log-format short
  24. ```
  25. Use with Logstalgia
  26. -------------------
  27. The "default" log-format is compatible with [logstalgia](http://code.google.com/p/logstalgia/).
  28. If you wrote your log output to disk, like so:
  29. ```sh
  30. $ ws --log-format default > web.log
  31. ```
  32. Then you could visualise in logstalgia with:
  33. ```sh
  34. $ logstalgia web.log
  35. ```
  36. Alternatively, pipe directly from ws into logstalgia for real-time visualisation:
  37. ```sh
  38. $ ws --log-format default | logstalgia -
  39. ```
  40. [![githalytics.com alpha](https://cruel-carlota.pagodabox.com/050b17b4263c08f12a2a9d9bbda80025 "githalytics.com")](http://githalytics.com/75lb/local-web-server)