Create a gist now

Instantly share code, notes, and snippets.

@justinyoo /webpack-startup.cs Secret
Last active Feb 13, 2017

Running Vue.js on ASP.NET Core Web Application
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory oggerFactory)
{
...
if (env.IsDevelopment())
{
...
// Setup WebpackDevMidleware for "Hot module replacement" while debugging
var options = new WebpackDevMiddlewareOptions() { HotModuleReplacement = true };
app.UseWebpackDevMiddleware(options);
}
else
...
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
// Setup additional routing for SPA
routes.MapSpaFallbackRoute(
name: "spa-fallback",
defaults: new { controller = "Home", action = "Index" });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment