cors
This commit is contained in:
@@ -35,12 +35,18 @@ var options = new WebApplicationOptions
|
|||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(options);
|
var builder = WebApplication.CreateBuilder(options);
|
||||||
|
|
||||||
|
var allowedOrigins = new string[]
|
||||||
|
{
|
||||||
|
"https://webshop.tzbre.dev",
|
||||||
|
"http://localhost:4200"
|
||||||
|
};
|
||||||
|
|
||||||
builder.Services.AddCors(options =>
|
builder.Services.AddCors(options =>
|
||||||
{
|
{
|
||||||
options.AddPolicy("AllowNuxtApp",
|
options.AddPolicy(name: "AllowSpecificOrigins",
|
||||||
policy =>
|
policy =>
|
||||||
{
|
{
|
||||||
policy.WithOrigins("http://localhost:3000")
|
policy.WithOrigins(allowedOrigins)
|
||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.AllowAnyMethod();
|
.AllowAnyMethod();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user