cors
This commit is contained in:
@@ -35,12 +35,18 @@ var options = new WebApplicationOptions
|
||||
|
||||
var builder = WebApplication.CreateBuilder(options);
|
||||
|
||||
var allowedOrigins = new string[]
|
||||
{
|
||||
"https://webshop.tzbre.dev",
|
||||
"http://localhost:4200"
|
||||
};
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("AllowNuxtApp",
|
||||
options.AddPolicy(name: "AllowSpecificOrigins",
|
||||
policy =>
|
||||
{
|
||||
policy.WithOrigins("http://localhost:3000")
|
||||
policy.WithOrigins(allowedOrigins)
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod();
|
||||
});
|
||||
@@ -300,8 +306,8 @@ app.UseStaticFiles();
|
||||
// Swagger/SwaggerUI f<>r API-Dokumentation aktivieren
|
||||
//'if (app.Environment.IsDevelopment())
|
||||
//{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
//}
|
||||
|
||||
// app.UseHttpsRedirection(); // Auskommentiert f<>r Docker HTTP-Entwicklung
|
||||
|
||||
Reference in New Issue
Block a user