exp:expstaticserve
Available since Exponential 6.0.15 (in development, not in a release yet).
Summary
Preview the static build of a target locally: PHP's built-in web server serves its folder below the target's base path, as GitHub Pages serves a project site
Usage
./console exp:expstaticserve [options] php bin/php/expstaticserve.php [options] ./console exp:static:serve [options]
Aliases
exp:static:serve
Help
The output of ./console help exp:expstaticserve (the script run with --help), without the standard options:
Usage: bin/php/expstaticserve.php [OPTION]... [TARGET] Preview a static build Serves the target's folder with PHP's built-in web server, below the target's base path (/my-site/) the way GitHub Pages serves a project site: a folder answers with its index.html, a missing page with 404.html. Listens on this computer only unless --host says otherwise; stop it with Ctrl+C. ./console exp:static:serve github-public http://127.0.0.1:8090/my-site/ ./console exp:static:serve github-public --base-path=/ at the root, as with a custom domain ./console exp:static:serve github-public --port=9000 Options: --port=VALUE The port of the preview server (default 8090) --host=VALUE The address the preview server listens on (default 127.0.0.1, this computer only) --base-path=VALUE Serve the folder below this path (default the target's BasePath; / for the root) --format=VALUE text (default) or json (the machine output exp-static/1)
Options
| Option | Value | Description |
|---|---|---|
| --port | required | The port of the preview server (default 8090) |
| --host | required | The address the preview server listens on (default 127.0.0.1, this computer only) |
| --base-path | required | Serve the folder below this path (default the target's BasePath; / for the root) |
| --format | required | text (default) or json (the machine output exp-static/1) |
Arguments
[target]
Standard options
Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.
Source
bin/php/expstaticserve.php, kernel/private/classes/commands/expstaticserve.php
See also
Generated example: exp:expstaticserve
Added to the reference for Exponential 6.0.15.
Contributors
- Graham Brookins Updated
Comments
Add a comment