forked from fsbolero/Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow minimal=false server=false using HttpClient instead of remoting
- Loading branch information
Showing
7 changed files
with
118 additions
and
22 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
namespace Bolero.Template.Client | ||
|
||
open Microsoft.AspNetCore.Components.WebAssembly.Hosting | ||
//#if (server_actual) | ||
open Bolero.Remoting.Client | ||
//#else | ||
open Microsoft.Extensions.DependencyInjection | ||
open System | ||
open System.Net.Http | ||
//#endif | ||
|
||
module Program = | ||
|
||
[<EntryPoint>] | ||
let Main args = | ||
let builder = WebAssemblyHostBuilder.CreateDefault(args) | ||
builder.RootComponents.Add<Main.MyApp>("#main") | ||
//#if (server_actual) | ||
builder.Services.AddRemoting(builder.HostEnvironment) |> ignore | ||
//#else | ||
builder.Services.AddScoped<HttpClient>(fun _ -> | ||
new HttpClient(BaseAddress = Uri builder.HostEnvironment.BaseAddress)) |> ignore | ||
//#endif | ||
builder.Build().RunAsync() |> ignore | ||
0 |
File renamed without changes.
Oops, something went wrong.