Configuration

The server starts on 127.0.0.1:8080 with plain HTTP/1.1. Create a profile when you want to change that behavior. A profile can contain just the settings your application needs.

What do you want to change?

Apply a profile

For example, to move the local server to port 9000, save this entire file as server.json next to your project’s vendor/ directory.

JSON
{
  "listen": { "port": 9000 }
}
Shell
php vendor/mini4work/webserver/examples/server.php server.json

In a second terminal, run curl http://127.0.0.1:9000/. The bundled handler returns JSON. Restart with the profile after editing it.

How the server reads a profile

At startup the server merges JSON objects with the installed package’s config/full.jsonc. In this example the default host is retained. A supplied list replaces the entire default list. Relative paths resolve from the directory containing the profile.

Use .jsonc for line or block comments. Inside a string, ${NAME} reads an environment variable at startup. Missing variables, unknown keys and incompatible values produce configuration errors. Point your editor at the package’s config/schema.json for completion.

Look up a setting

Browse configuration keys by topic