diff --git a/aspnetcore/blazor/components/index.md b/aspnetcore/blazor/components/index.md index 635073966467..741c6b7ef6d4 100644 --- a/aspnetcore/blazor/components/index.md +++ b/aspnetcore/blazor/components/index.md @@ -3579,7 +3579,7 @@ Common Blazor naming conventions used throughout the Blazor documentation includ Routing in Blazor is achieved by providing a route template to each accessible component in the app with an [`@page`][9] directive. When a Razor file with an [`@page`][9] directive is compiled, the generated class is given a specifying the route template. At runtime, the router searches for component classes with a and renders whichever component has a route template that matches the requested URL. -The following `HelloWorld` component uses a route template of `/hello-world`. The rendered webpage for the component is reached at the relative URL `/hello-world`. When running a Blazor app locally with the default protocol, host, and port, the `HelloWorld` component is requested in the browser at `https://localhost:5001/hello-world`. Components that produce webpages usually reside in the `Pages` folder, but you can use any folder to hold components, including within nested folders. +The following `HelloWorld` component uses a route template of `/hello-world`, and the rendered webpage for the component is reached at the relative URL `/hello-world`. Components that produce webpages usually reside in the `Pages` folder, but you can use any folder to hold components, including within nested folders. `Pages/HelloWorld.razor`: diff --git a/aspnetcore/blazor/debug.md b/aspnetcore/blazor/debug.md index 63304c41be7b..18e61eaf5c3b 100644 --- a/aspnetcore/blazor/debug.md +++ b/aspnetcore/blazor/debug.md @@ -1513,7 +1513,7 @@ The following launch configuration options are supported for the `blazorwasm` de | Option | Description | | --------- | ----------- | | `request` | Use `launch` to launch and attach a debugging session to a Blazor WebAssembly app or `attach` to attach a debugging session to an already-running app. | -| `url` | The URL to open in the browser when debugging. Defaults to `https://localhost:5001`. If the app is running at a different URL, an `about:blank` tab launches in the browser. | +| `url` | The URL to open in the browser when debugging. | | `browser` | The browser to launch for the debugging session. Set to `edge` or `chrome`. Defaults to `edge`. | | `trace` | Used to generate logs from the JS debugger. Set to `true` to generate logs. | | `hosted` | Must be set to `true` if launching and debugging a hosted Blazor WebAssembly app. | @@ -1562,7 +1562,7 @@ For more information, see [Debugging with Visual Studio for Mac](/visualstudio/m 1. Run a Debug build of the app in the Development environment. -1. Launch a browser and navigate to the app's URL (for example, `https://localhost:7268`). +1. Launch a browser and navigate to the app's URL. 1. In the browser, attempt to commence remote debugging by pressing Shift+Alt+d. diff --git a/aspnetcore/blazor/fundamentals/routing.md b/aspnetcore/blazor/fundamentals/routing.md index 54bc4c4db71a..4513ef6e8eed 100644 --- a/aspnetcore/blazor/fundamentals/routing.md +++ b/aspnetcore/blazor/fundamentals/routing.md @@ -1511,7 +1511,7 @@ Route constraints also work with [optional parameters](#route-parameters). In th ## Routing with URLs that contain dots -For hosted Blazor WebAssembly and Blazor Server apps, the server-side default route template assumes that if the last segment of a request URL contains a dot (`.`) that a file is requested. For example, the URL `https://localhost.com:5001/example/some.thing` is interpreted by the router as a request for a file named `some.thing`. Without additional configuration, an app returns a *404 - Not Found* response if `some.thing` was meant to route to a component with an [`@page`](xref:mvc/views/razor#page) directive and `some.thing` is a route parameter value. To use a route with one or more parameters that contain a dot, the app must configure the route with a custom template. +For hosted Blazor WebAssembly and Blazor Server apps, the server-side default route template assumes that if the last segment of a request URL contains a dot (`.`) that a file is requested. For example, the relative URL `/example/some.thing` is interpreted by the router as a request for a file named `some.thing`. Without additional configuration, an app returns a *404 - Not Found* response if `some.thing` was meant to route to a component with an [`@page`](xref:mvc/views/razor#page) directive and `some.thing` is a route parameter value. To use a route with one or more parameters that contain a dot, the app must configure the route with a custom template. Consider the following `Example` component that can receive a route parameter from the last segment of the URL. @@ -1579,7 +1579,7 @@ The following component: * The `HandleLocationChanged` method is unhooked when `Dispose` is called by the framework. Unhooking the method permits garbage collection of the component. * The logger implementation logs the following information when the button is selected: - > `BlazorSample.Pages.Navigate: Information: URL of new location: https://localhost:5001/counter` + > `BlazorSample.Pages.Navigate: Information: URL of new location: https://localhost:{PORT}/counter` `Pages/Navigate.razor`: @@ -1934,7 +1934,7 @@ There are two option * : The is active when it matches the entire current URL. * (*default*): The is active when it matches any prefix of the current URL. -In the preceding example, the Home `href=""` matches the home URL and only receives the `active` CSS class at the app's default base path URL (for example, `https://localhost:5001/`). The second receives the `active` class when the user visits any URL with a `component` prefix (for example, `https://localhost:5001/component` and `https://localhost:5001/component/another-segment`). +In the preceding example, the Home `href=""` matches the home URL and only receives the `active` CSS class at the app's default base path (`/`). The second receives the `active` class when the user visits any URL with a `component` prefix (for example, `/component` and `/component/another-segment`). Additional component attributes are passed through to the rendered anchor tag. In the following example, the component includes the `target` attribute: diff --git a/aspnetcore/blazor/security/webassembly/additional-scenarios.md b/aspnetcore/blazor/security/webassembly/additional-scenarios.md index 809356cce3d1..a9cbda4dccfe 100644 --- a/aspnetcore/blazor/security/webassembly/additional-scenarios.md +++ b/aspnetcore/blazor/security/webassembly/additional-scenarios.md @@ -371,9 +371,9 @@ The following policy includes configuration for: ```csharp app.UseCors(policy => policy.WithOrigins("http://localhost:5000", "https://localhost:5001") - .AllowAnyMethod() - .WithHeaders(HeaderNames.ContentType, HeaderNames.Authorization, "x-custom-header") - .AllowCredentials()); + .AllowAnyMethod() + .WithHeaders(HeaderNames.ContentType, HeaderNames.Authorization, "x-custom-header") + .AllowCredentials()); ``` A hosted Blazor solution based on the [Blazor WebAssembly project template](xref:blazor/project-structure) uses the same base address for the client and server apps. The client app's is set to a URI of `builder.HostEnvironment.BaseAddress` by default. CORS configuration is **not** required in the default configuration of a hosted Blazor solution. Additional client apps that aren't hosted by the server project and don't share the server app's base address **do** require CORS configuration in the server project. @@ -1594,9 +1594,9 @@ The following policy includes configuration for: ```csharp app.UseCors(policy => policy.WithOrigins("http://localhost:5000", "https://localhost:5001") - .AllowAnyMethod() - .WithHeaders(HeaderNames.ContentType, HeaderNames.Authorization, "x-custom-header") - .AllowCredentials()); + .AllowAnyMethod() + .WithHeaders(HeaderNames.ContentType, HeaderNames.Authorization, "x-custom-header") + .AllowCredentials()); ``` A hosted Blazor solution based on the [Blazor WebAssembly project template](xref:blazor/project-structure) uses the same base address for the client and server apps. The client app's is set to a URI of `builder.HostEnvironment.BaseAddress` by default. CORS configuration is **not** required in the default configuration of a hosted Blazor solution. Additional client apps that aren't hosted by the server project and don't share the server app's base address **do** require CORS configuration in the server project. @@ -2821,9 +2821,9 @@ The following policy includes configuration for: ```csharp app.UseCors(policy => policy.WithOrigins("http://localhost:5000", "https://localhost:5001") - .AllowAnyMethod() - .WithHeaders(HeaderNames.ContentType, HeaderNames.Authorization, "x-custom-header") - .AllowCredentials()); + .AllowAnyMethod() + .WithHeaders(HeaderNames.ContentType, HeaderNames.Authorization, "x-custom-header") + .AllowCredentials()); ``` A hosted Blazor solution based on the [Blazor WebAssembly project template](xref:blazor/project-structure) uses the same base address for the client and server apps. The client app's is set to a URI of `builder.HostEnvironment.BaseAddress` by default. CORS configuration is **not** required in the default configuration of a hosted Blazor solution. Additional client apps that aren't hosted by the server project and don't share the server app's base address **do** require CORS configuration in the server project. diff --git a/aspnetcore/blazor/security/webassembly/standalone-with-authentication-library.md b/aspnetcore/blazor/security/webassembly/standalone-with-authentication-library.md index 5fdfe052c301..7db623f89442 100644 --- a/aspnetcore/blazor/security/webassembly/standalone-with-authentication-library.md +++ b/aspnetcore/blazor/security/webassembly/standalone-with-authentication-library.md @@ -89,7 +89,7 @@ Configuration is supplied by the `wwwroot/appsettings.json` file: } ``` -Google OAuth 2.0 OIDC example: +Google OAuth 2.0 OIDC example for an app that runs on the localhost address at port 5001: ```json { @@ -273,7 +273,7 @@ Configuration is supplied by the `wwwroot/appsettings.json` file: } ``` -Google OAuth 2.0 OIDC example: +Google OAuth 2.0 OIDC example for an app that runs on the localhost address at port 5001: ```json { diff --git a/aspnetcore/blazor/webassembly-lazy-load-assemblies.md b/aspnetcore/blazor/webassembly-lazy-load-assemblies.md index 557a737f58e9..e326f95bdd58 100644 --- a/aspnetcore/blazor/webassembly-lazy-load-assemblies.md +++ b/aspnetcore/blazor/webassembly-lazy-load-assemblies.md @@ -354,7 +354,7 @@ Build and run the app again. For the default page that loads the `Index` compone ![Index component loaded in the browser with developer tool's Network tab indicating that the GrantImaharaRobotControls.dll assembly isn't loaded.](~/blazor/webassembly-lazy-load-assemblies/_static/screenshot2.png) -If the `Robot` component from the RCL is requested at `https://localhost:5001/robot`, the `GrantImaharaRobotControls.dll` assembly is loaded and the `Robot` component is rendered: +If the `Robot` component from the RCL is requested at `/robot`, the `GrantImaharaRobotControls.dll` assembly is loaded and the `Robot` component is rendered: ![Robot component loaded in the browser with developer tool's Network tab indicating that the GrantImaharaRobotControls.dll assembly is loaded.](~/blazor/webassembly-lazy-load-assemblies/_static/screenshot3.png) @@ -724,7 +724,7 @@ Build and run the app again. For the default page that loads the `Index` compone ![Index component loaded in the browser with developer tool's Network tab indicating that the GrantImaharaRobotControls.dll assembly isn't loaded.](~/blazor/webassembly-lazy-load-assemblies/_static/screenshot2.png) -If the `Robot` component from the RCL is requested at `https://localhost:5001/robot`, the `GrantImaharaRobotControls.dll` assembly is loaded and the `Robot` component is rendered: +If the `Robot` component from the RCL is requested at `/robot`, the `GrantImaharaRobotControls.dll` assembly is loaded and the `Robot` component is rendered: ![Robot component loaded in the browser with developer tool's Network tab indicating that the GrantImaharaRobotControls.dll assembly is loaded.](~/blazor/webassembly-lazy-load-assemblies/_static/screenshot3.png)