2022-07-15 06:47:50 +08:00
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
builder.Services.AddControllers();
|
|
|
|
var app = builder.Build();
|
2022-07-16 06:24:39 +08:00
|
|
|
var uri = "/WeatherForecast/GetByRange?range=" +
|
|
|
|
$"{DateTime.Now.Date.ToShortDateString()}-" +
|
|
|
|
$"{DateTime.Now.AddDays(5).Date.ToShortDateString()}";
|
|
|
|
|
|
|
|
app.MapGet("/", () => Results.Redirect(uri));
|
2022-07-15 06:47:50 +08:00
|
|
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
|
|
app.MapControllers();
|
|
|
|
|
|
|
|
app.Run();
|