-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProgram.cs
More file actions
23 lines (19 loc) · 799 Bytes
/
Program.cs
File metadata and controls
23 lines (19 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Linq2GraphQL.Docs;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using TabBlazor;
using StarWars.Client;
using Linq2GraphQL.Client;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddTabler();
builder.Services.AddStarWarsClient(x =>
{
x.UseSafeMode = false;
x.SubscriptionProtocol = SubscriptionProtocol.ServerSentEvents;
})
.WithHttpClient(
httpClient => { httpClient.BaseAddress = new Uri("https://swapi-graphql.netlify.app/graphql"); });
await builder.Build().RunAsync();