From 725cd7e08ad7cfdbf5264ac4a6c01f5ff801a2f9 Mon Sep 17 00:00:00 2001 From: "theis.gaedigk" Date: Fri, 15 Aug 2025 10:12:51 +0200 Subject: [PATCH] changed ports to run on my server --- backend/Dockerfile | 2 +- docker-compose.yml | 26 +++++++++++++------------- frontend/Dockerfile | 2 +- frontend/src/utils/fileHandler.ts | 2 +- frontend/src/utils/handleSubmit.ts | 2 +- frontend/src/utils/register.ts | 2 +- frontend/src/utils/tableActions.ts | 6 +++--- frontend/src/utils/userHandler.ts | 2 +- frontend/vite.config.ts | 3 ++- 9 files changed, 24 insertions(+), 23 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 7167e5a..e471423 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -7,6 +7,6 @@ RUN npm install COPY . . -EXPOSE 8002 +EXPOSE 8502 CMD ["npm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index d23a129..53948c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,21 +1,21 @@ services: - # mcs_lose-frontend: - # container_name: mcs_lose-frontend - # build: ./frontend - # ports: - # - "8001:8001" - # environment: - # - CHOKIDAR_USEPOLLING=true - # volumes: - # - ./frontend:/app - # - /app/node_modules - # restart: unless-stopped + mcs_lose-frontend: + container_name: mcs_lose-frontend + build: ./frontend + ports: + - "8501:8501" + environment: + - CHOKIDAR_USEPOLLING=true + volumes: + - ./frontend:/app + - /app/node_modules + restart: unless-stopped mcs_lose-backend: container_name: mcs_lose-backend_express build: ./backend ports: - - "8002:8002" + - "8502:8502" environment: DB_HOST: mysql DB_USER: root @@ -37,7 +37,7 @@ services: volumes: - mysql-data:/var/lib/mysql ports: - - "3308:3306" + - "8500:3306" volumes: mysql-data: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index b7dad9b..3161275 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -7,6 +7,6 @@ RUN npm install COPY . . -EXPOSE 8001 +EXPOSE 8501 CMD ["npm", "run", "dev"] \ No newline at end of file diff --git a/frontend/src/utils/fileHandler.ts b/frontend/src/utils/fileHandler.ts index 65015e8..2713c68 100644 --- a/frontend/src/utils/fileHandler.ts +++ b/frontend/src/utils/fileHandler.ts @@ -55,7 +55,7 @@ export async function postCSV(file: File): Promise { const chunkSize = 2000; // ~2k per request => 25 requests for 50k for (let i = 0; i < lines.length; i += chunkSize) { const chunk = lines.slice(i, i + chunkSize); - const res = await fetch("http://localhost:8002/create-entry", { + const res = await fetch("https://backend.lose.the1s.de/create-entry", { method: "POST", headers: { "Content-Type": "application/json", diff --git a/frontend/src/utils/handleSubmit.ts b/frontend/src/utils/handleSubmit.ts index ed82f3d..418966c 100644 --- a/frontend/src/utils/handleSubmit.ts +++ b/frontend/src/utils/handleSubmit.ts @@ -20,7 +20,7 @@ export const handleSubmit = async (e: React.FormEvent) => { let response: Response; try { - response = await fetch("http://localhost:8002/login", { + response = await fetch("https://backend.lose.the1s.de/login", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ username, password }), diff --git a/frontend/src/utils/register.ts b/frontend/src/utils/register.ts index ad91110..863c755 100644 --- a/frontend/src/utils/register.ts +++ b/frontend/src/utils/register.ts @@ -1,7 +1,7 @@ import { myToast } from "./toastify"; export const registerLos = async (data: any) => { - await fetch("http://localhost:8002/lose", { + await fetch("https://backend.lose.the1s.de/lose", { method: "POST", headers: { "Content-Type": "application/json", diff --git a/frontend/src/utils/tableActions.ts b/frontend/src/utils/tableActions.ts index 6b45633..457dc39 100644 --- a/frontend/src/utils/tableActions.ts +++ b/frontend/src/utils/tableActions.ts @@ -30,7 +30,7 @@ function createHeaders(token: string) { export const removeSelection = (token: string) => { const selection = Cookies.get("removeArr"); if (selection && selection !== "[]") { - fetch("http://localhost:8002/remove-entries", { + fetch("https://backend.lose.the1s.de/remove-entries", { method: "DELETE", headers: createHeaders(token), body: `{ @@ -50,7 +50,7 @@ export const removeSelection = (token: string) => { }; export const saveRow = (data: any, token: string) => { - fetch("http://localhost:8002/save-row", { + fetch("https://backend.lose.the1s.de/save-row", { method: "PUT", headers: createHeaders(token), body: JSON.stringify(data), @@ -64,7 +64,7 @@ export const saveRow = (data: any, token: string) => { }; export const resetData = (token: string) => { - fetch("http://localhost:8002/reset-data", { + fetch("https://backend.lose.the1s.de/reset-data", { method: "DELETE", headers: createHeaders(token), }).then((response) => { diff --git a/frontend/src/utils/userHandler.ts b/frontend/src/utils/userHandler.ts index ed15b10..793080c 100644 --- a/frontend/src/utils/userHandler.ts +++ b/frontend/src/utils/userHandler.ts @@ -10,7 +10,7 @@ export const logoutAdmin = () => { // Fetch table data and store it in localStorage. Returns the parsed data or null on failure. export const getTableData = async (token: string) => { try { - const response = await fetch("http://localhost:8002/table-data", { + const response = await fetch("https://backend.lose.the1s.de/table-data", { method: "GET", headers: { Authorization: `Bearer ${token}`, diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index dd0234a..a793e81 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -7,7 +7,8 @@ export default defineConfig({ plugins: [react(), svgr(), tailwindcss()], server: { host: "0.0.0.0", - port: 8001, + port: 8501, + https: true, watch: { usePolling: true, },