-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
57 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Funq; | ||
using ServiceStack; | ||
using MyApp.ServiceInterface; | ||
|
||
[assembly: HostingStartup(typeof(MyApp.AppHost))] | ||
|
||
namespace MyApp; | ||
|
||
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) {} | ||
|
||
public override void Configure(Container container) | ||
{ | ||
RawHttpHandlers.Add(ApiHandlers.Json("/api/{Request}")); | ||
|
||
// enable server-side rendering, see: https://sharpscript.net/docs/sharp-pages | ||
Plugins.Add(new SpaFeature { | ||
EnableSpaFallback = true | ||
}); | ||
|
||
SetConfig(new HostConfig { | ||
AddRedirectParamsToQueryString = true, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,14 @@ | ||
using System; | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.Extensions.Logging; | ||
using ServiceStack; | ||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
namespace MyApp | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
CreateHostBuilder(args).Build().Run(); | ||
} | ||
var app = builder.Build(); | ||
|
||
public static IHostBuilder CreateHostBuilder(string[] args) => | ||
Host.CreateDefaultBuilder(args) | ||
.ConfigureWebHostDefaults(builder => | ||
{ | ||
builder.UseModularStartup<Startup>(); | ||
}); | ||
} | ||
// Configure the HTTP request pipeline. | ||
if (!app.Environment.IsDevelopment()) | ||
{ | ||
app.UseExceptionHandler("/Error"); | ||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. | ||
app.UseHsts(); | ||
app.UseHttpsRedirection(); | ||
} | ||
|
||
app.Run(); |
This file was deleted.
Oops, something went wrong.