|
|
@ -38,7 +38,8 @@ namespace EPAServeur |
|
|
|
options.AddPolicy(name: AllowCrossClientEPA, |
|
|
|
options.AddPolicy(name: AllowCrossClientEPA, |
|
|
|
builder => |
|
|
|
builder => |
|
|
|
{ |
|
|
|
{ |
|
|
|
builder.WithOrigins("http://localhost:4200").AllowAnyHeader().AllowAnyMethod(); |
|
|
|
builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod();//WithOrigins("http://digitepa_proxy/").AllowAnyHeader().AllowAnyMethod(); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -53,6 +54,8 @@ namespace EPAServeur |
|
|
|
{ |
|
|
|
{ |
|
|
|
o.Authority = Configuration["Jwt:Authority"]; |
|
|
|
o.Authority = Configuration["Jwt:Authority"]; |
|
|
|
o.Audience = Configuration["Jwt:Audience"]; |
|
|
|
o.Audience = Configuration["Jwt:Audience"]; |
|
|
|
|
|
|
|
o.TokenValidationParameters.ValidateIssuer = false; |
|
|
|
|
|
|
|
//o.TokenValidationParameters.ValidIssuers = Configuration.GetSection("Jwt:ValidIssuers").Get<string[]>(); |
|
|
|
|
|
|
|
|
|
|
|
if (Environment.IsDevelopment()) |
|
|
|
if (Environment.IsDevelopment()) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -95,15 +98,16 @@ namespace EPAServeur |
|
|
|
|
|
|
|
|
|
|
|
services.AddDbContext<EpContext>(b => b.UseMySQL(Configuration["Data:DefaultConnection:ConnectionString"])); |
|
|
|
services.AddDbContext<EpContext>(b => b.UseMySQL(Configuration["Data:DefaultConnection:ConnectionString"])); |
|
|
|
|
|
|
|
|
|
|
|
var optionBuider = new DbContextOptionsBuilder<EpContext>() |
|
|
|
/*var optionBuider = new DbContextOptionsBuilder<EpContext>() |
|
|
|
.UseMySQL(Configuration["Data:DefaultConnection:ConnectionString"]) |
|
|
|
//.UseMySQL(Configuration["Data:DefaultConnection:ConnectionString"]) |
|
|
|
|
|
|
|
.UseMySQL("server=localhost;database=server_ep;user=root;password=root") |
|
|
|
.Options; |
|
|
|
.Options; |
|
|
|
|
|
|
|
|
|
|
|
using (var context = new EpContext(optionBuider)) |
|
|
|
using (var context = new EpContext(optionBuider)) { };*/ |
|
|
|
{ |
|
|
|
/*{ |
|
|
|
context.Database.EnsureDeleted(); //PENSEZ A ENLEVER CETTE LIGNE ET A NE JAMAIS LA REMETTRE QUAND LE SERVEUR SERA MIS EN PRODUCTION ^^ |
|
|
|
//context.Database.EnsureDeleted(); //PENSEZ A ENLEVER CETTE LIGNE ET A NE JAMAIS LA REMETTRE QUAND LE SERVEUR SERA MIS EN PRODUCTION ^^ |
|
|
|
context.Database.EnsureCreated(); |
|
|
|
//context.Database.EnsureCreated(); |
|
|
|
context.SaveChanges(); |
|
|
|
//context.SaveChanges(); |
|
|
|
|
|
|
|
|
|
|
|
DataSeeder.AddInformationsDeBase(context); |
|
|
|
DataSeeder.AddInformationsDeBase(context); |
|
|
|
DataSeeder.AddChamps(context); |
|
|
|
DataSeeder.AddChamps(context); |
|
|
@ -112,7 +116,7 @@ namespace EPAServeur |
|
|
|
DataSeeder.AddEngagements(context); |
|
|
|
DataSeeder.AddEngagements(context); |
|
|
|
DataSeeder.AddEp(context); |
|
|
|
DataSeeder.AddEp(context); |
|
|
|
DataSeeder.AddRereferentEP(context); |
|
|
|
DataSeeder.AddRereferentEP(context); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
//faire using, check si kekchoz exkist puis appeler les m<EFBFBD>thodes de cr<EFBFBD>ation si il n'y a rien |
|
|
|
//faire using, check si kekchoz exkist puis appeler les m<EFBFBD>thodes de cr<EFBFBD>ation si il n'y a rien |
|
|
|
|
|
|
|
|
|
|
|
//API Collaborateurs |
|
|
|
//API Collaborateurs |
|
|
|