I just follow https://github.com/MicrosoftDocs/visualstudio-docs/blob/main/docs/javascript/tutorial-asp-net-core-with-react.md to publish my project to local folder and then add new web site on iis. but I don`t know how browse the index.html that created in wwwroot folder to work with api, browsing result to : No webpage was found for the web address: http://localhost:7080/wwwroot/index.html HTTP ERROR 404
Should two separate sites be created on iis?
Program.cs :
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();
The index file:
Browse WebSite :
and the result :
And the postman for test api that was Success :






