Remembering a domain
By default, Surge will prompt you for a domain each time you deploy. To skip this, you can pass it into the CLI when you run the
surge command. For example, if your subdomain was
vancouver.surge.sh, you could run the following command:
surge --domain vancouver.surge.sh
Saving your domain to a
You can also save your domain to a
CNAME file so you don’t have to type it into the CLI either. Add a
CNAME file (no extension) to the root of the project you’re deploying, and Surge will use that automatically.
You can create a new
CNAME file in your text editor of choice:
You may also do it directly from the CLI using the following command:
echo vancouver.surge.sh > CNAME
vancouver.surge.sh with your own domain or subdomain.