From 7c29bec9510748c432f86f8bedb282fff91660a7 Mon Sep 17 00:00:00 2001 From: koudenpa Date: Sun, 26 Jul 2020 23:44:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Static=20web=20app=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=82=82=E3=83=9B=E3=82=B9=E3=83=86=E3=82=A3=E3=83=B3?= =?UTF-8?q?=E3=82=B0=E3=81=99=E3=82=8B=E3=81=8A=E8=A9=A6=E3=81=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Client/Program.cs | 7 ++++- .../Client/wwwroot/index.html | 30 +++++++++++++++++++ .../Client/wwwroot/routes.json | 8 +++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 BlazorMultiComputerVisionWebasm/Client/wwwroot/index.html create mode 100644 BlazorMultiComputerVisionWebasm/Client/wwwroot/routes.json diff --git a/BlazorMultiComputerVisionWebasm/Client/Program.cs b/BlazorMultiComputerVisionWebasm/Client/Program.cs index 16da20f..64dbe9e 100644 --- a/BlazorMultiComputerVisionWebasm/Client/Program.cs +++ b/BlazorMultiComputerVisionWebasm/Client/Program.cs @@ -24,7 +24,12 @@ public static async Task Main(string[] args) // XXX これだと認証されたユーザーのリクエストからもパラメータが無くなっちゃうんだよね。困るね。 builder.Services.AddSingleton(new AllowGuestHttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - builder.Services.AddHttpClient("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("BlazorMultiComputerVisionWebasm.ServerAPI", client => client.BaseAddress = apiBase) .AddHttpMessageHandler(); // Supply HttpClient instances that include access tokens when making requests to the server project diff --git a/BlazorMultiComputerVisionWebasm/Client/wwwroot/index.html b/BlazorMultiComputerVisionWebasm/Client/wwwroot/index.html new file mode 100644 index 0000000..f719a77 --- /dev/null +++ b/BlazorMultiComputerVisionWebasm/Client/wwwroot/index.html @@ -0,0 +1,30 @@ +サソ + + + + + + MultiComputerVision - BlazorWebasm + + + + + + + + + + Loading... + +
+ An unhandled error has occurred. + Reload + +
+ + + + + + + diff --git a/BlazorMultiComputerVisionWebasm/Client/wwwroot/routes.json b/BlazorMultiComputerVisionWebasm/Client/wwwroot/routes.json new file mode 100644 index 0000000..e3e33a0 --- /dev/null +++ b/BlazorMultiComputerVisionWebasm/Client/wwwroot/routes.json @@ -0,0 +1,8 @@ +サソ{ + "routes": [ + { + "route": "/*", + "serve": "/index.html" + } + ] +} \ No newline at end of file From 6633f778900f9db1134c94ceacf09a5e8bd86a22 Mon Sep 17 00:00:00 2001 From: koudenpa Date: Sun, 26 Jul 2020 23:53:44 +0900 Subject: [PATCH 2/2] Update azure-static-web-apps-icy-stone-037d9d81e.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 菴輔°繧、繝ウ繝繝ウ繝亥、峨□縺」縺溘i縺励>縲 --- .../azure-static-web-apps-icy-stone-037d9d81e.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-icy-stone-037d9d81e.yml b/.github/workflows/azure-static-web-apps-icy-stone-037d9d81e.yml index 0c93acf..be697b2 100644 --- a/.github/workflows/azure-static-web-apps-icy-stone-037d9d81e.yml +++ b/.github/workflows/azure-static-web-apps-icy-stone-037d9d81e.yml @@ -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