-
Notifications
You must be signed in to change notification settings - Fork 69
docs: document the 'Use *.dev.localhost URLs?' interactive prompt for aspire new
#697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7eaf486
14cfe68
2f96ae2
1b4737a
5688592
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,7 @@ description: Learn about the aspire new command and its usage. This command crea | |||||||||||||||||||||
| import AsciinemaPlayer from '@components/AsciinemaPlayer.astro'; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| import Include from '@components/Include.astro'; | ||||||||||||||||||||||
| import LearnMore from '@components/LearnMore.astro'; | ||||||||||||||||||||||
| import { Aside } from '@astrojs/starlight/components'; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Name | ||||||||||||||||||||||
|
|
@@ -33,6 +34,50 @@ This command defaults to **interactive** mode. When executed without any options | |||||||||||||||||||||
| with Aspire templates as an alternative for project creation. | ||||||||||||||||||||||
| </Aside> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Interactive prompts | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| When running `aspire new` in interactive mode, the command asks one or more questions before generating the project. The available prompts depend on the template and options you provide. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ### Use \*.dev.localhost URLs? | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| During project creation, you may be prompted: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| > **Use \*.dev.localhost URLs?** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| This prompt determines whether the generated launch profile configures your Aspire services to be accessible via `*.dev.localhost` wildcard subdomain URLs (for example, `https://myservice.dev.localhost`) instead of standard `http://localhost` with port numbers. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: This paragraph packs DNS resolution behavior, browser support exceptions, and HTTPS certificate details into one block. Consider splitting it into two paragraphs — one for DNS/browser resolution and one for the certificate trust story — to make it easier to scan. |
||||||||||||||||||||||
| #### What are \*.dev.localhost URLs? | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is missing lots of nuance about what these are and aren't. The biggest being that it only works in browsers. |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| `*.dev.localhost` is a wildcard subdomain pattern that resolves to your local machine (`127.0.0.1` or `::1`) in most modern browsers without additional DNS configuration. Safari on macOS is an exception and may require hosts-file entries for `*.dev.localhost` subdomains. The ASP.NET Core HTTPS development certificate includes `*.dev.localhost` as a Subject Alternative Name (SAN), so browsers trust connections to any subdomain under `*.dev.localhost` when the certificate is installed and trusted. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #### Yes — use \*.dev.localhost URLs | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Choosing **Yes** configures the generated project so that each service gets a unique subdomain URL such as `https://myservice.dev.localhost`. This option: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - Enables HTTPS for all services from the start, leveraging the wildcard development certificate. | ||||||||||||||||||||||
| - Gives each service its own origin, which prevents cookie and authentication token collisions between services running on the same machine. | ||||||||||||||||||||||
|
IEvangelist marked this conversation as resolved.
|
||||||||||||||||||||||
| - More closely mirrors a production setup where services are hosted on separate (sub)domains. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Prerequisite:** The ASP.NET Core HTTPS development certificate must be installed and trusted on your machine. Run the following command if you haven't done so already: | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is true, but I would just say developer cert and move all of the details about the cert to the cert article. |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```bash title="Aspire CLI" | ||||||||||||||||||||||
| aspire certs trust | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <LearnMore> | ||||||||||||||||||||||
| [Command reference: `aspire certs trust`](../aspire-certs-trust/) | ||||||||||||||||||||||
| </LearnMore> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <Aside type="note"> | ||||||||||||||||||||||
| Safari on macOS does not resolve `*.dev.localhost` subdomains to | ||||||||||||||||||||||
| `127.0.0.1` by default. If you use Safari, choose **No** or add an entry to | ||||||||||||||||||||||
| your hosts file. | ||||||||||||||||||||||
| </Aside> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #### No — use standard localhost URLs (default) | ||||||||||||||||||||||
|
Comment on lines
+73
to
+77
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: "add an entry to your hosts file" leaves the reader guessing what the entry should be. A brief inline example would make this immediately actionable:
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Choosing **No** (the default) configures services with standard `http://localhost:<port>` addresses. This option requires no certificate setup and works in all browsers and tools without additional configuration. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Options | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The following options are available: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: The Safari caveat is mentioned here and again in the
<Aside>on line 73. Consider dropping the inline mention from this paragraph and relying solely on the callout — it's more prominent and avoids saying the same thing twice.