Skip to content

HTTP/1

The HTTP/1 is the protocol by default and can be used by specifying a host address via the -a, --host (SERVER_HOST) argument, the port of the host via -p, --port (SERVER_PORT) and the directory of the static files using the -d, --root (SERVER_ROOT) argument.

Tips

  • Either --host, --port and --root have defaults (optional values) so they can be specified or omitted as required.
  • The server provides Termination Signal handling with Graceful Shutdown ability by default.

Below is an example of how to run the server using HTTP/1.

static-web-server \
    --host 127.0.0.1 \
    --port 8787 \
    --root ./my-public-dir