Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Last active February 13, 2017 12:28
Show Gist options
  • Save justinyoo/674a14c338a4f182164db7bb13e4a63b to your computer and use it in GitHub Desktop.
Save justinyoo/674a14c338a4f182164db7bb13e4a63b to your computer and use it in GitHub Desktop.
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