Skip to content

Commit

Permalink
RSS-Reader is upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
dodyg committed Sep 6, 2019
1 parent c7ec1b1 commit f1505c2
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.JSInterop
@using DependencyInjection.Services
@using DependencyInjection.Services
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Authorization
4 changes: 3 additions & 1 deletion projects/blazor-ss/JsIntegration/Components/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
@using Microsoft.AspNetCore.Components.Forms

@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.JSInterop
@using Microsoft.JSInterop
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Authorization
2 changes: 1 addition & 1 deletion projects/blazor-ss/JsIntegration/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</head>
<body>
<div class="container">
<app></app>
<app>@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))</app>
</div>
<script src="_framework/blazor.server.js"></script>
</body>
Expand Down
2 changes: 2 additions & 0 deletions projects/blazor-ss/Layout/Components/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.JSInterop
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Authorization
2 changes: 1 addition & 1 deletion projects/blazor-ss/Layout/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
<app></app>
<app>@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))</app>

<script src="_framework/blazor.server.js"></script>
</body>
Expand Down
8 changes: 4 additions & 4 deletions projects/blazor-ss/Layout/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public void Configure(IApplicationBuilder app, IHostEnvironment env)
app.UseStaticFiles();

app.UseRouting();
app.UseEndpoints(routes =>
app.UseEndpoints(endpoints =>
{
routes.MapRazorPages();
routes.MapFallbackToPage("/Index");
routes.MapBlazorHub<App>("app");
endpoints.MapRazorPages();
endpoints.MapFallbackToPage("/Index");
endpoints.MapBlazorHub();
});
}
}
Expand Down
16 changes: 9 additions & 7 deletions projects/blazor-ss/RssReader-2/Components/App.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<CascadingAuthenticationState>
<Router AppAssembly="typeof(Startup).Assembly">
<NotFoundContent>
<p>Sorry, there's nothing at this address.</p>
</NotFoundContent>
</Router>
</CascadingAuthenticationState>
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" />
</Found>
<NotFound>
<h1>Page not found</h1>
<p>Sorry, but there's nothing here!</p>
</NotFound>
</Router>
4 changes: 3 additions & 1 deletion projects/blazor-ss/RssReader-2/Components/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.JSInterop
@using RssReader.Services
@using RssReader.Services
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Authorization
3 changes: 1 addition & 2 deletions projects/blazor-ss/RssReader-2/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
<app></app>

<app>@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))</app>
<script src="_framework/blazor.server.js"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions projects/blazor-ss/RssReader-2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public void Configure(IApplicationBuilder app, IHostEnvironment env)
app.UseStaticFiles();

app.UseRouting();
app.UseEndpoints(routes =>
app.UseEndpoints(endpoints =>
{
routes.MapRazorPages();
routes.MapFallbackToPage("/Index");
routes.MapBlazorHub<App>("app");
endpoints.MapRazorPages();
endpoints.MapFallbackToPage("/Index");
endpoints.MapBlazorHub();
});
}
}
Expand Down
16 changes: 9 additions & 7 deletions projects/blazor-ss/RssReader/Components/App.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<CascadingAuthenticationState>
<Router AppAssembly="typeof(Startup).Assembly">
<NotFoundContent>
<p>Sorry, there's nothing at this address.</p>
</NotFoundContent>
</Router>
</CascadingAuthenticationState>
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" />
</Found>
<NotFound>
<h1>Page not found</h1>
<p>Sorry, but there's nothing here!</p>
</NotFound>
</Router>
4 changes: 3 additions & 1 deletion projects/blazor-ss/RssReader/Components/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.JSInterop
@using RssReader.Services
@using RssReader.Services
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Authorization
3 changes: 2 additions & 1 deletion projects/blazor-ss/RssReader/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
<app></app>
<app>@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))</app>


<script src="_framework/blazor.server.js"></script>
</body>
Expand Down
8 changes: 4 additions & 4 deletions projects/blazor-ss/RssReader/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public void Configure(IApplicationBuilder app, IHostEnvironment env)
app.UseStaticFiles();

app.UseRouting();
app.UseEndpoints(routes =>
app.UseEndpoints(endpoints =>
{
routes.MapRazorPages();
routes.MapFallbackToPage("/Index");
routes.MapBlazorHub<App>("app");
endpoints.MapRazorPages();
endpoints.MapFallbackToPage("/Index");
endpoints.MapBlazorHub();
});
}
}
Expand Down

0 comments on commit f1505c2

Please sign in to comment.