Last active
March 22, 2017 22:07
-
-
Save Maarten88/6f0507332b71ca93578213f5ae8c1a83 to your computer and use it in GitHub Desktop.
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
var host = new WebHostBuilder() | |
[...] | |
.ConfigureServices(services => | |
{ | |
[...] | |
services.AddNodeServices(options => { | |
if ("development".Equals(environment, StringComparison.OrdinalIgnoreCase)) | |
{ | |
options.LaunchWithDebugging = true; | |
options.DebuggingPort = 5858; | |
} | |
options.NodeInstanceOutputLogger = loggerFactory.CreateLogger("Node Console Logger"); | |
}); | |
[...] | |
} | |
.Configure(app => | |
{ | |
var env = app.ApplicationServices.GetService<IHostingEnvironment>(); | |
if (env.IsDevelopment()) | |
{ | |
app.UseDeveloperExceptionPage(); | |
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions | |
{ | |
HotModuleReplacement = true, | |
HotModuleReplacementServerPort = 6000, | |
ReactHotModuleReplacement = true, | |
}); | |
} | |
[...] | |
app.UseMvc(routes => | |
{ | |
routes.MapRoute( | |
name: "default", | |
template: "{controller=Home}/{action=Index}/{id?}"); | |
routes.MapSpaFallbackRoute( | |
name: "spa-fallback", | |
defaults: new { controller = "Home", action = "Index" }); | |
}); | |
} | |
[...] | |
.Build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment