-
-
Save justinyoo/674a14c338a4f182164db7bb13e4a63b to your computer and use it in GitHub Desktop.
Running Vue.js on ASP.NET Core Web Application
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
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