Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliang-wt committed Jun 8, 2023
1 parent 433a883 commit 1b6fbcb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions demo/WalkingTec.Mvvm.Vue3Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.AspNetCore.SpaServices;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using VueCliMiddleware;
Expand Down Expand Up @@ -80,17 +81,19 @@
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
if (app.Environment.EnvironmentName == "Development")
{
endpoints.MapToVueCliProxy(
"{*path}",
new SpaOptions { SourcePath = "ClientApp" },
npmScript: "start",
regex: "No issues found.");
}
endpoints.MapFallbackToFile(app.Environment.IsDevelopment() ? "index_dev.html" : "");
});


app.UseWtmContext();
if (app.Environment.IsDevelopment())
{
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
});
}

app.Run();

public partial class Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>4.5</TypeScriptToolsVersion>
Expand Down

0 comments on commit 1b6fbcb

Please sign in to comment.