Changement pour appeler l'API C# par Angular
+ récupération des datas et leur affichage
This commit is contained in:
@@ -17,13 +17,24 @@ namespace skydiveLogs_api
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
|
||||
|
||||
// CORS
|
||||
services.AddCors(options =>
|
||||
{
|
||||
//options.AddPolicy(MyAllowSpecificOrigins,
|
||||
options.AddDefaultPolicy(
|
||||
builder =>
|
||||
{
|
||||
builder.WithOrigins("http://localhost:4200")
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod();
|
||||
});
|
||||
});
|
||||
|
||||
// IoC
|
||||
var iocService = new IocService(services);
|
||||
iocService.Configure();
|
||||
@@ -44,8 +55,14 @@ namespace skydiveLogs_api
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseCors(); // (MyAllowSpecificOrigins);
|
||||
|
||||
//app.UseHttpsRedirection();
|
||||
app.UseMvc();
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
readonly string MyAllowSpecificOrigins = "_allowSpecificOrigins";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user