2
0

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 FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 6530
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src WORKDIR /src

View File

@ -36,7 +36,7 @@ builder.Services.AddCors(options =>
options.AddPolicy(name: corsHeader, options.AddPolicy(name: corsHeader,
policy => policy =>
{ {
policy.WithOrigins("http://localhost", "http://127.0.0.1", "http://localhost:63342"); policy.WithOrigins("*");
policy.WithMethods("GET", "POST", "DELETE"); 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){ async function GetData(uri){
let request = await fetch(uri, { let request = await fetch(uri, {