使用单个spa注入.net MVC应用作为微前端



我有一个。net MVC应用程序在https://localhost:7166/中运行,我在Angular中有另一个应用程序在http://localhost:9002/中运行。我正试着用single-spa把这些组合成一个microfrontend

我有一个基本的应用程序,所有的应用程序都被导入。

<% if (isLocal) { %>
<script type="systemjs-importmap">
{
"imports": {
"@single-spa/welcome": "https://unpkg.com/single-spa-welcome/dist/single-spa-welcome.js",
"@angular-app/angular-project": "http://localhost:9002/main.js",
"@dotnet/home":"http://localhost:7166/"
}
}
</script>
<% } %>
<<p>路线/strong>
<single-spa-router>
<main>
<route default>
<application name="@dotnet/home"></application>
</route>
<route path="flights-search">
<application name="@angular-flightBooking/angular-flightbooking"></application>
</route>
</main>
</single-spa-router>

angular应用程序运行正常,但是dotnet应用程序在浏览器中返回CORS问题。有谁能帮帮忙吗?

. net MVC web应用程序不能与single-spa一起用作微服务。single-spa只适用于JavaScript框架,这是。net MVC web应用程序而不是的东西。.

最新更新