Skip to content

Commit

Permalink
Move AppHost init to Program.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Feb 8, 2022
1 parent 9742e40 commit 3bee6f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
5 changes: 0 additions & 5 deletions MyApp/Configure.AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ public class AppHost : AppHostBase, IHostingStartup
public void Configure(IWebHostBuilder builder) => builder
.ConfigureServices(services => {
// Configure ASP.NET Core IOC Dependencies
})
.Configure(app => {
// Configure ASP.NET Core App
if (!HasInit)
app.UseServiceStack(new AppHost());
});

public AppHost() : base("MyApp", typeof(MyServices).Assembly) {}
Expand Down
4 changes: 4 additions & 0 deletions MyApp/MyApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
<ItemGroup>
<Using Include="MyApp" />
<Using Include="ServiceStack" />
</ItemGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
Expand Down
1 change: 1 addition & 0 deletions MyApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
app.UseHsts();
app.UseHttpsRedirection();
}
app.UseServiceStack(new AppHost());

app.Run();
14 changes: 7 additions & 7 deletions MyApp/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3bee6f0

Please sign in to comment.