./node_modules/.bin/server <command> [options]
Tip: In NPM
scripts the relative path (
./node_modules/.bin/) may be omitted. Looks neater.
Table of Contents
Options that apply across all commands.
Display the current version number.
List global or command-specific options.
Start the server as a long running process that spawns workers.
The environment variable
PORT sets the network port for incoming HTTPS connections.
http.to options in the configuration file are set to
http.from port is derived by setting the last three decimal digits of
$PORT set to
000. E.g. HTTPS
8443 -> HTTP
443 -> HTTP
10080 -> HTTP
Configuration file path. Defaults to:
If no configuration file is found, the default configuration is used. See the Configuration section for details.
The default configuration loads
./serverpush.json as a server push manifest, if it exists. See
@commonshost/manifest generate for details.
false, which is the same as specifying the
The server maintains an in-memory index of all files. Compared to dynamic filesystem scanning, this dramatically improves performance when pushing many small files. However if files and directories are added, moved, or deleted, the index becomes incorrect. Pass the
--watch option to monitor filesystem changes and automatically rebuild the index. This has some performance cost, depending on operating system specific support, so watching is disabled by default. Watching is typically only used in development mode, not production.
Shuts down the server by sending it the
Gracefully restart workers with a new configuration by sending the server the
Loads and validates a server configuration.
The process prints
PASS and exits
0 if the configuration is valid, or otherwise prints
FAIL with an error message and exits
Identical to the same option of the