Stops the start when the files of AppConfig.tls, or of a port of
AppConfig.ports, are bad: it throws a TlsException.
Dox().startServer() runs it once, before any isolate starts. Else
each isolate fails on its own and is started again, in a loop. It
does nothing when no port has tls.
Reads the certificate and key files of AppConfig.tls, and of each
port of AppConfig.ports with tls, again, for example after
certbot renewed them. New connections get the new
certificate. Open connections keep the old one until they close.
One call is enough: every isolate of the process gets it. When a
file is bad, it throws a TlsException and the server keeps the old
certificate. With more than one certificate, it checks all the
files first, so a bad file changes no port. A file that changes
between the check and the reload can still stop it half way: then
call it again. It throws a StateError when no port has tls, before
the server starts and after it is closed. Dox does not watch the files:
the app decides when to call it (eg. on SIGHUP).
Throws an ArgumentError when an app with ports lists a port two
times, in port, additional and ports together. Such a port
would be bound two times (the OS allows it), with two kinds of
settings. Port 0 is a free port each time, so it can repeat. With no
ports it checks nothing, as before AppConfig.ports.
Dox().startServer() runs it once, before any isolate starts. Else
each isolate fails on its own and is started again, in a loop.
The port to listen on. APP_PORT in the env means configured (the
app reads it into serverPort). With no APP_PORT, PORT wins:
Cloud Run, Fly, Render and Heroku tell the app its port with it.