forked from MDCPS/DamageAssessment_Backend
conflict resolution
This commit is contained in:
@ -8,10 +8,16 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
// CORS setup to allow requests from any origin.
|
||||
builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => {
|
||||
build.WithOrigins("*").AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin();
|
||||
}));
|
||||
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
//builder.Services.AddSwaggerGen();
|
||||
// Add Swagger/OpenAPI documentation support.
|
||||
builder.Services.AddSwaggerGen(c =>
|
||||
{
|
||||
// Include XML comments from your assembly
|
||||
@ -32,16 +38,23 @@ builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => {
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
app.UseCors("DamageAppCorsPolicy");
|
||||
app.UseAuthorization();
|
||||
=======
|
||||
|
||||
>>>>>>> 9ec9b8b96fc7c5767fcddf1e4e52bde203fcf619
|
||||
|
||||
// Enable CORS, authentication, and authorization middleware.
|
||||
app.UseCors("DamageAppCorsPolicy");
|
||||
app.UseAuthorization();
|
||||
// Map controllers to their respective routes.
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
|
Reference in New Issue
Block a user