fix cors in Program.cs
This commit is contained in:
6
.idea/.idea.ApiEfCoreLibrary/.idea/data_source_mapping.xml
generated
Normal file
6
.idea/.idea.ApiEfCoreLibrary/.idea/data_source_mapping.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourcePerFileMappings">
|
||||||
|
<file url="file://$PROJECT_DIR$/.idea/.idea.ApiEfCoreLibrary/.idea/queries/Query.sql" value="afc9949f-8c13-4d86-8c8c-8a2edf026c4e" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
0
.idea/.idea.ApiEfCoreLibrary/.idea/queries/Query.sql
generated
Normal file
0
.idea/.idea.ApiEfCoreLibrary/.idea/queries/Query.sql
generated
Normal file
6
.idea/.idea.ApiEfCoreLibrary/.idea/sqldialects.xml
generated
Normal file
6
.idea/.idea.ApiEfCoreLibrary/.idea/sqldialects.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="SqlDialectMappings">
|
||||||
|
<file url="file://$PROJECT_DIR$/.idea/.idea.ApiEfCoreLibrary/.idea/queries/Query.sql" dialect="TSQL" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -12,17 +12,14 @@ builder.Services
|
|||||||
.AddFastEndpoints()
|
.AddFastEndpoints()
|
||||||
.AddCors(options =>
|
.AddCors(options =>
|
||||||
{
|
{
|
||||||
options.AddPolicy("AllowAll", policy =>
|
options.AddDefaultPolicy( policy =>
|
||||||
{
|
{
|
||||||
policy.AllowAnyOrigin()
|
policy.AllowAnyOrigin();
|
||||||
.AllowAnyMethod()
|
|
||||||
.AllowAnyHeader();
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.SwaggerDocument(options =>
|
.SwaggerDocument(options =>
|
||||||
{
|
{
|
||||||
options.ShortSchemaNames = true;
|
options.ShortSchemaNames = true;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// On ajoute ici la configuration de la base de données
|
// On ajoute ici la configuration de la base de données
|
||||||
@@ -41,6 +38,6 @@ app//.UseAuthentication()
|
|||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
app.UseCors("AllowAll");
|
app.UseCors();
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
Reference in New Issue
Block a user