v1.1
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" href="/favicon.ico" sizes="any" />
|
||||
<link rel="icon" type="image/png" href="/favicon-32.png" />
|
||||
<link rel="icon" type="image/png" sizes="512x512" href="/favicon-512.png" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<title>Rezept Finder</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
@@ -3,7 +3,9 @@ import { createRoot } from 'react-dom/client';
|
||||
import { io } from 'socket.io-client';
|
||||
import './style.css';
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:5000';
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || '/api';
|
||||
const SOCKET_ORIGIN = import.meta.env.VITE_SOCKET_ORIGIN || window.location.origin;
|
||||
const SOCKET_PATH = import.meta.env.VITE_SOCKET_PATH || `${API_BASE}/socket.io`;
|
||||
|
||||
function shuffle(items) {
|
||||
const shuffled = [...items];
|
||||
@@ -33,7 +35,7 @@ function App() {
|
||||
const votingRoundRef = useRef(null);
|
||||
const SWIPE_THRESHOLD = 110;
|
||||
|
||||
const socket = useMemo(() => io(API_URL, { autoConnect: false }), []);
|
||||
const socket = useMemo(() => io(SOCKET_ORIGIN, { autoConnect: false, path: SOCKET_PATH }), []);
|
||||
const votedRecipeIdSet = useMemo(() => new Set(votedRecipeIds), [votedRecipeIds]);
|
||||
const orderedRecipes = useMemo(() => {
|
||||
if (session?.matchMode !== 'final_round') {
|
||||
@@ -117,7 +119,7 @@ function App() {
|
||||
setError('');
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const response = await fetch(`${API_URL}/api/sessions`, {
|
||||
const response = await fetch(`${API_BASE}/sessions`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name: hostName || 'Host' }),
|
||||
@@ -143,7 +145,7 @@ function App() {
|
||||
setError('');
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const response = await fetch(`${API_URL}/api/sessions/${code}/join`, {
|
||||
const response = await fetch(`${API_BASE}/sessions/${code}/join`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name: guestName || 'Gast' }),
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
const apiTarget = process.env.VITE_DEV_API_TARGET || 'http://backend:5000';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: apiTarget,
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user