Default: process.env.PORT or 3000 or memorized random (see get-port-please)
Port to listen.
hostname
Default: process.env.HOST || '0.0.0.0'
Default hostname to listen.
https
Type: Boolean | Object
Default: false
Listen on HTTPS with SSL enabled.
Self-Signed Certificate
By setting https: true, listhen will use an auto-generated self-signed certificate.
You can set https to an object for custom options. Possible options:
domains: (Array) Default is ['localhost', '127.0.0.1', '::1'].
validityDays: (Number) Default is 1.
User-Provided Certificate
Set https: { cert, key } where the cert and key are paths to the SSL certificates.
With an encrypted private key, you also need to set passphrase on the https object.
To provide a certificate stored in a keystore set https: { pfx } with a path to the keystore.
When the keystore is password protected also set passphrase.
You can also provide an inline cert and key instead of reading from the filesystem. In this case, they should start with --.
showURL
Default: true (force disabled on a test environment)
Show a CLI message for the listening URL.
baseURL
Default: /
open
Default: false (force disabled on test and production environments)
Open the URL in the browser. Silently ignores errors.
clipboard
Default: false (force disabled on test and production environments)
Copy the URL to the clipboard. Silently ignores errors.
isTest
Default: process.env.NODE_ENV === 'test'
Detect if running in a test environment to disable some features.
autoClose
Default: true
Automatically close when an exit event, SIGTERM, SIGINT or SIGHUP signal is received in the process.