Changed CORS policy allow all origins

Added Dockerfile to website
Changed Ports
This commit is contained in:
glax 2023-05-24 22:30:11 +02:00
parent 32dc58715e
commit e2917d2f2e
4 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
EXPOSE 6530
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src

View File

@ -36,7 +36,7 @@ builder.Services.AddCors(options =>
options.AddPolicy(name: corsHeader,
policy =>
{
policy.WithOrigins("http://localhost", "http://127.0.0.1", "http://localhost:63342");
policy.WithOrigins("*");
policy.WithMethods("GET", "POST", "DELETE");
});
});

4
Website/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM nginx:1.10.1-alpine
COPY . /usr/share/nginx/html
EXPOSE 6531
CMD ["nginx", "-g", "daemon off;"]

View File

@ -1,4 +1,4 @@
const apiUri = "http://localhost:5177";
const apiUri = "http://localhost:6530";
async function GetData(uri){
let request = await fetch(uri, {