-
Notifications
You must be signed in to change notification settings - Fork 87
How to launch a development web server
Lloyd Brookes edited this page Jun 2, 2018
·
11 revisions
This example will serve your working directory as a static web site.
- Instal local-web-server to get the
ws
command.
$ npm install -g local-web-server
- Navigate into to your project
$ cd example-project
- Launch the webserver. By default it hosts your project as a static site.
$ ws
Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:8000
-
Navigating to one of the listed URLs will render a directory listing or your
index.html
, if that file exists.Tip: iTerm users can cmd+click a server URL to open it in the default browser
- Listen on a single host.
$ ws --hostname mbp.local
Serving at http://mbp.local:8000
- Password-protect your server.
$ ws --auth.user lloyd --auth.pass secret
Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:8000