Remove unused React logo SVG and add new API client and layouts
The React logo SVG file was removed as it was no longer needed. Introduced an auto-generated API client class (`ApiClient.ts`) for handling server communication and added new components for the navigation menu and higher-order layouts (`NavMenu`, `with_main_layout.ts.tsx`). Updated `yarn.lock` to replace legacy URL references.
This commit is contained in:
@@ -10,18 +10,14 @@ builder.Services.AddOpenApi();
|
||||
builder.Services.AddSignalR();
|
||||
builder.Services.AddHostedService<SignalRSendService>();
|
||||
builder.Services.AddSingleton<IUserIdProvider, UserProvider>();
|
||||
builder.Services.AddOpenApiDocument(config =>
|
||||
{
|
||||
config.Title = "NSwag Demo API";
|
||||
});
|
||||
builder.Services.AddOpenApiDocument(config => { config.Title = "NSwag Demo API"; });
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddDefaultPolicy(policy =>
|
||||
{
|
||||
policy.WithOrigins("http://localhost:3000") // Specify the allowed origin
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod()
|
||||
.AllowCredentials(); // Allow credentials
|
||||
policy.AllowAnyOrigin()
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,8 +27,8 @@ var app = builder.Build();
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.MapOpenApi();
|
||||
app.UseOpenApi();
|
||||
app.UseSwaggerUi();
|
||||
app.UseOpenApi();
|
||||
app.UseSwaggerUi();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
@@ -44,19 +40,19 @@ var summaries = new[]
|
||||
};
|
||||
|
||||
app.MapGet("/weatherforecast", async () =>
|
||||
{
|
||||
var forecast = Enumerable.Range(1, 5).Select(index =>
|
||||
new WeatherForecast
|
||||
(
|
||||
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
|
||||
Random.Shared.Next(-20, 55),
|
||||
summaries[Random.Shared.Next(summaries.Length)]
|
||||
))
|
||||
.ToArray();
|
||||
{
|
||||
var forecast = Enumerable.Range(1, 2500).Select(index =>
|
||||
new WeatherForecast
|
||||
(
|
||||
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
|
||||
Random.Shared.Next(-20, 55),
|
||||
summaries[Random.Shared.Next(summaries.Length)]
|
||||
))
|
||||
.ToArray();
|
||||
|
||||
return forecast;
|
||||
})
|
||||
.WithName("GetWeatherForecast");
|
||||
return forecast;
|
||||
})
|
||||
.WithName("GetWeatherForecast");
|
||||
|
||||
|
||||
// Add SignalR hub
|
||||
@@ -67,4 +63,4 @@ app.Run();
|
||||
record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
|
||||
{
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user