Verified Commit c83a38a9 authored by Aral Balkan's avatar Aral Balkan
Browse files

Add www as a shorthand alias for www.<hostname|manually-set-domain>

parent 8554ff28
......@@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Breaking change
- Starting a server now only provisions a TLS certificate for and serves _hostname_ (it no longer also provisions a TLS certificate for and aliases the _www_ subdomain). If you want to have _www_ subdomain support, add _www.<hostname>_ via the `--aliases` option manually.
- Starting a server now only provisions a TLS certificate for and serves _hostname_ (it no longer also provisions a TLS certificate for and aliases the _www_ subdomain). If you want to have _www_ subdomain support, add _www_ via the `--aliases` option manually.
### Added
......
......@@ -505,7 +505,7 @@ If `command` is omitted, behaviour defaults to `serve`.
- `--domain`: The main domain to serve (defaults to system hostname if not specified).
- `--aliases`: Comma-separated list of additional domains to obtain TLS certificates for and respond to. These domains point to the main domain via a 302 redirect.
- `--aliases`: Comma-separated list of additional domains to obtain TLS certificates for and respond to. These domains point to the main domain via a 302 redirect. Note that as of 13.0.0, the _www_ alias is not added automatically. To specify it, you can use the shorthand form:`--aliases=www`
#### For the `serve` command:
......@@ -559,7 +559,7 @@ When you `serve` a site at `@hostname` or use the `enable` command, globally-tru
| ----------------------------------------- | ------------------------------------------------------------- |
| Serve current folder | site @hostname |
| Serve current folder at specified domain | site @hostname --domain=my.site |
| Serve current folder also at aliases | site @hostname --aliases=other.site,www.other.site |
| Serve current folder also at aliases | site @hostname --aliases=www,other.site,www.other.site |
| Serve folder demo* | site demo @hostname |
| | site serve demo @hostname |
| Proxy localhost:1313 to https://hostname | site serve :1313 @hostname |
......
......@@ -187,7 +187,7 @@ class Help {
`}
• Serve current folder\t\t\t${prompt} ${appName} ${argument('@hostname')}
• Serve current folder at specified domain\t${prompt} ${appName} ${argument('@hostname')} ${optionDomain}=${argument('my.site')}
• Serve current folder also at aliases\t${prompt} ${appName} ${argument('@hostname')} ${optionAliases}=${argument('other.site,www.other.site')}
• Serve current folder also at aliases\t${prompt} ${appName} ${argument('@hostname')} ${optionAliases}=${argument('www,other.site,www.other.site')}
• Serve folder ${argument('demo')}\t\t\t\t${prompt} ${appName} ${argument('demo')} ${argument('@hostname')}
(shorthand and full)\t\t\t${prompt} ${appName} ${commandServe} ${argument('demo')} ${argument('@hostname')}
......
......@@ -231,8 +231,8 @@ class Site {
this.global = typeof options.global === 'boolean' ? options.global : false
this.aliases = Array.isArray(options.aliases) ? options.aliases : []
// The www subdomain is a default alias.
// this.aliases.push(`www.${Site.hostname}`)
// Substitute shorthand www alias for full domain.
this.aliases = this.aliases.map(alias => alias === 'www' ? `www.${Site.hostname}` : alias)
// Has a proxy server been requested? If so, we flag it and save the port
// we were asked to proxy. In this case, pathToServe is ignored/unused.
......
......@@ -450,7 +450,7 @@ test('[commands] help', t => {
• Serve current folder ▶ site @hostname
• Serve current folder at specified domain ▶ site @hostname --domain=my.site
• Serve current folder also at aliases ▶ site @hostname --aliases=other.site,www.other.site
• Serve current folder also at aliases ▶ site @hostname --aliases=www,other.site,www.other.site
• Serve folder demo ▶ site demo @hostname
(shorthand and full) ▶ site serve demo @hostname
......@@ -537,7 +537,7 @@ test('[commands] help', t => {
• Serve current folder ▶ site @hostname
• Serve current folder at specified domain ▶ site @hostname --domain=my.site
• Serve current folder also at aliases ▶ site @hostname --aliases=other.site,www.other.site
• Serve current folder also at aliases ▶ site @hostname --aliases=www,other.site,www.other.site
• Serve folder demo ▶ site demo @hostname
(shorthand and full) ▶ site serve demo @hostname
......@@ -602,7 +602,7 @@ test('[commands] help', t => {
• Serve current folder ▶ site "@hostname"
• Serve current folder at specified domain ▶ site "@hostname" --domain=my.site
• Serve current folder also at aliases ▶ site "@hostname" --aliases=other.site,www.other.site
• Serve current folder also at aliases ▶ site "@hostname" --aliases=www,other.site,www.other.site
• Serve folder demo ▶ site demo "@hostname"
(shorthand and full) ▶ site serve demo "@hostname"
......@@ -684,7 +684,7 @@ test('[commands] help', t => {
• Serve current folder ▶ site @hostname
• Serve current folder at specified domain ▶ site @hostname --domain=my.site
• Serve current folder also at aliases ▶ site @hostname --aliases=other.site,www.other.site
• Serve current folder also at aliases ▶ site @hostname --aliases=www,other.site,www.other.site
• Serve folder demo ▶ site demo @hostname
(shorthand and full) ▶ site serve demo @hostname
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment