generated from VLADIMIR/template_frontend
ups
This commit is contained in:
@@ -0,0 +1 @@
|
||||
VITE_API_URL='https://evening-detective-api.crabs-games.art'
|
||||
@@ -0,0 +1 @@
|
||||
VITE_API_URL=''
|
||||
@@ -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
|
||||
|
||||
Generated
+371
-1106
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user