Skip to content
Permalink
Browse files

Upgrade to ModularStartup

  • Loading branch information...
mythz committed Aug 10, 2019
1 parent bb4f08f commit 74f3f70710a6cc93d0f15fcb8a846157ca49cddf
Showing with 12 additions and 7 deletions.
  1. +1 −2 MyApp.ServiceInterface/MyServices.cs
  2. +11 −5 MyApp/Startup.cs
@@ -18,8 +18,7 @@ public class FallbackForClientRoutes
public class MyServices : Service
{
//Return index.html for unmatched requests so routing is handled on client
public object Any(FallbackForClientRoutes request) =>
Request.GetPageResult("/");
public object Any(FallbackForClientRoutes request) => Request.GetPageResult("/");

public object Any(Hello request)
{
@@ -8,17 +8,22 @@
using ServiceStack;
using ServiceStack.Configuration;
using MyApp.ServiceInterface;
using ServiceStack.Script;
using ServiceStack.Web;
using System;
using ServiceStack.Text;
using ServiceStack.Logging;

namespace MyApp
{
public class Startup
public class Startup : ModularStartup
{
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration) => Configuration = configuration;
public Startup(IConfiguration configuration)
: base(configuration, typeof(MyServices).Assembly) {}

// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
public new void ConfigureServices(IServiceCollection services)
{
}

@@ -48,8 +53,9 @@ public override void Configure(Container container)

SetConfig(new HostConfig
{
UseSameSiteCookies = true,
AddRedirectParamsToQueryString = true,
DebugMode = AppSettings.Get(nameof(HostConfig.DebugMode), false)
DebugMode = AppSettings.Get(nameof(HostConfig.DebugMode), HostingEnvironment.IsDevelopment()),
});
}
}

0 comments on commit 74f3f70

Please sign in to comment.
You can’t perform that action at this time.