Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
  - name: Set up .NET Core
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
 with:
with:
dotnet-version: '3.1.x'
 - name: Build Blazor Application
 run: dotnet publish -c Release -p:DefineConstants=AZURE_STATIC_WEB_APP ./BlazorMultiComputerVisionWebasm/Client/BlazorMultiComputerVisionWebasm.Client.csproj
- name: Build Blazor Application
run: dotnet publish -c Release -p:DefineConstants=AZURE_STATIC_WEB_APP ./BlazorMultiComputerVisionWebasm/Client/BlazorMultiComputerVisionWebasm.Client.csproj
- name: Deploy
id: deploy
uses: Azure/static-web-apps-deploy@v0.0.1-preview
Expand Down
7 changes: 6 additions & 1 deletion BlazorMultiComputerVisionWebasm/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ public static async Task Main(string[] args)
// XXX ���ꂾ�ƔF�؂��ꂽ���[�U�[�̃��N�G�X�g������p�����[�^�������Ȃ����Ⴄ�񂾂�ˁB����ˁB
builder.Services.AddSingleton(new AllowGuestHttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

builder.Services.AddHttpClient<AuthHttpClient>("BlazorMultiComputerVisionWebasm.ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
#if AZURE_STATIC_WEB_APP
var apiBase = new Uri("https://blazormulticomputervisionwebasmserver.azurewebsites.net/");
#else
var apiBase = new Uri(builder.HostEnvironment.BaseAddress);
#endif
builder.Services.AddHttpClient<AuthHttpClient>("BlazorMultiComputerVisionWebasm.ServerAPI", client => client.BaseAddress = apiBase)
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();

// Supply HttpClient instances that include access tokens when making requests to the server project
Expand Down
30 changes: 30 additions & 0 deletions BlazorMultiComputerVisionWebasm/Client/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>MultiComputerVision - BlazorWebasm</title>
<base href="/" />
<link href="_content/MultiComputerVisionRazorComponents/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="_content/MultiComputerVisionRazorComponents/css/app.css" rel="stylesheet" />
<link href="manifest.json" rel="manifest" />
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
</head>

<body>
<app>
<text>Loading...</text>
</app>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"></script>
<script src="_content/BlazorInputFile/inputfile.js"></script>
<script src="_framework/blazor.webassembly.js"></script>
<script>navigator.serviceWorker.register('service-worker.js');</script>
</body>

</html>
8 changes: 8 additions & 0 deletions BlazorMultiComputerVisionWebasm/Client/wwwroot/routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"routes": [
{
"route": "/*",
"serve": "/index.html"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ルートの設定自体はこんなもんでいい。
(ちゃんと index.html に行った)

https://docs.microsoft.com/ja-jp/azure/static-web-apps/routes#fallback-routes

}
]
}