This commit is contained in:
2026-05-17 16:06:14 +07:00
parent 6f60e41584
commit 4e61a9d405
6 changed files with 388 additions and 1113 deletions
+1
View File
@@ -0,0 +1 @@
VITE_API_URL='https://evening-detective-api.crabs-games.art'
+1
View File
@@ -0,0 +1 @@
VITE_API_URL=''
+7 -5
View File
@@ -1,7 +1,9 @@
build:
@echo "Build static files"
npm run build
@echo "Remove old version from server repository"
build-macos:
npm run build:local_web
rm -rf ../evening_detective/cmd/evening_detective/static/admin
cp -r dist ../evening_detective/cmd/evening_detective/static/admin
build-linux:
npm run build:global_web
rm -rf ../evening_detective/cmd/evening_detective/static/admin
@echo "Copy new version to server repository"
cp -r dist ../evening_detective/cmd/evening_detective/static/admin
+371 -1106
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -5,6 +5,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"build:local_web": "vite build --mode local_web",
"build:global_web": "vite build --mode global_web",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
+6 -2
View File
@@ -1,6 +1,8 @@
import type { Game, GraphNode, Teams } from './models'
import { downloadData } from './qr'
const API_URL = import.meta.env.VITE_API_URL;
export const apiGetTeams = async (): Promise<Teams> => {
try {
const response = await fetch(getApiUrl('/teams'))
@@ -129,6 +131,8 @@ export const updateNode = async (code: string, node: GraphNode) => {
}
function getApiUrl(path: string) {
// return 'http://' + window.location.host.split(':')[0] + ':8090' + path
return 'https://evening-detective-api.crabs-games.art' + path
if (API_URL === '') {
return 'http://' + window.location.host.split(':')[0] + ':8090' + path
}
return API_URL + path
}