Simple web server using PHP built-in web server. Windows only. If you are on macOS, locally installed PHP will be run (with given params).
Node.js and npm already installed on your machine.
Install package via npm
in your project as a dependency:
npm install light-web-server --save-dev
In your project directory:
lws --hostname=192.168.1.252 --port=9000 --dir=test/
It will start the web server available at http://192.168.1.252:9000/
(default hostname is localhost
, default port is :8000
).
URI requests are served from the current working directory, unless the --dir=
flag (parameter) is used to specify an explicit document root.
Parameter | Description |
---|---|
hostname |
port (default localhost ) |
port |
port (default 8000 ) |
dir |
document root directory |
7.1.11