GeezerVison is showing github.com — Move Razor CustomErrorHttpHandlers to Configure.Ui · ServiceStack/ServiceStackVS@9fcbc9c
File tree
Expand file treeCollapse file tree
Open diff view settings
src/ServiceStackVS/ProjectTemplates/AspNetRazor/Host
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/ServiceStackVS/ProjectTemplates/AspNetRazor/Host/AppHost.cs -7Lines changed: 0 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | | -using System.Linq; |
4 | | -using System.Net; |
5 | | -using System.Reflection; |
6 | | -using System.Web; |
7 | 3 | using Funq; |
8 | 4 | using $safeprojectname$.ServiceInterface; |
9 | 5 | using ServiceStack.Razor; |
@@ -35,9 +31,6 @@ public override void Configure(Container container) |
35 | 31 |
|
36 | 32 | Plugins.Add(new RazorFormat()); |
37 | 33 |
|
38 | | - CustomErrorHttpHandlers[HttpStatusCode.NotFound] = new RazorHandler("/notfound"); |
39 | | - CustomErrorHttpHandlers[HttpStatusCode.Forbidden] = new RazorHandler("/forbidden"); |
40 | | - |
41 | 34 | if (Config.DebugMode) |
42 | 35 | { |
43 | 36 | Plugins.Add(new HotReloadFeature()); |
|
Collapse file
Copy file name to clipboardExpand all lines: src/ServiceStackVS/ProjectTemplates/AspNetRazor/Host/Configure.Ui.cs +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +using System.Net; |
1 | 2 | using System.Collections.Generic; |
2 | 3 | using ServiceStack; |
| 4 | +using ServiceStack.Razor; |
3 | 5 |
|
4 | 6 | namespace $safeprojectname$ |
5 | 7 | { |
6 | 8 | public class ConfigureUi : IConfigureAppHost |
7 | 9 | { |
8 | 10 | public void Configure(IAppHost appHost) |
9 | 11 | { |
| 12 | + appHost.CustomErrorHttpHandlers[HttpStatusCode.NotFound] = new RazorHandler("/notfound"); |
| 13 | + appHost.CustomErrorHttpHandlers[HttpStatusCode.Forbidden] = new RazorHandler("/forbidden"); |
| 14 | + |
10 | 15 | Svg.Load(appHost.RootDirectory.GetDirectory("/assets/svg")); |
11 | 16 | Svg.CssFillColor["svg-icons"] = "#343a40"; |
12 | 17 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/ServiceStackVS/ProjectTemplates/AspNetRazor/Host/Host.csproj -3Lines changed: 0 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
110 | 110 | <ItemGroup> |
111 | 111 | <TypeScriptCompile Include="wwwroot\assets\js\dtos.ts" /> |
112 | 112 | </ItemGroup> |
113 | | - <ItemGroup> |
114 | | - <Service Include="{4A0DDDB5-7A95-4FBF-97CC-616D07737A77}" /> |
115 | | - </ItemGroup> |
116 | 113 | <ItemGroup> |
117 | 114 | <Folder Include="wwwroot\css\" /> |
118 | 115 | <Folder Include="wwwroot\js\" /> |
|