Starting and Stopping
The web server lifecycle can be managed both automatically (plugin startup/shutdown) and manually (in-game commands).
Automatic Lifecycle
| Event | Server Action |
|---|---|
| Plugin enable | Web server starts automatically after config validation |
| Plugin disable | Web server stops, all handlers are cleaned up, GraalJS contexts are closed |
Config reload (/zyveraweb reload) |
Reloads config.yml but does not restart the server |
Manual Control
Use the /zyveraweb server command to control the server at runtime:
| Command | Action |
|---|---|
/zyveraweb server start |
Start the web server |
/zyveraweb server stop |
Stop the web server |
/zyveraweb server restart |
Stop, then start the web server |
Permission: zyveraweb.server.command (default: op)
What Happens on Start
- Reads
host,portfrom config. - Determines server mode: if any site has an
sslblock, starts HTTPS on the public port + HTTP on internal port; otherwise starts HTTP on the public port. - Parses virtual host sites from config.
- Creates endpoint handlers:
- Virtual host handler for routing
- Or a single file handler if no sites configured
- Installs npm dependencies for Node.js projects (async).
- Creates an
HttpServerorHttpsServerinstance. - Binds to the configured host:port.
- Registers cleanup tasks (rate limiter garbage collection).
What Happens on Stop
- The HTTP server stops accepting new connections.
- All GraalJS contexts are closed.
- Existing requests complete normally.
Checking Server Status
/zyveraweb
The status shows either Running (green) or Stopped (red) next to "Web Server".
No comments to display
No comments to display