exp:expstaticserve
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.
Script bin/php/expstaticserve.php, code in kernel/private/classes/commands/expstaticserve.php. Run it from the installation root, as the user the web server runs as:
./console exp:expstaticserve --help
./console exp:static:serve --help
php bin/php/expstaticserve.php --helpHelp text
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=9000Options
| Option | Value | Help |
|---|---|---|
--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) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Arguments: [target].
Related
Generated by ./console exp:help:examples from bin/php/expstaticserve.php, kernel/private/classes/commands/expstaticserve.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.