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:
|
build-macos:
|
||||||
@echo "Build static files"
|
npm run build:local_web
|
||||||
npm run build
|
rm -rf ../evening_detective/cmd/evening_detective/static/admin
|
||||||
@echo "Remove old version from server repository"
|
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
|
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
|
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",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"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 {@}\" --",
|
"build": "run-p type-check \"build-only {@}\" --",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"build-only": "vite build",
|
"build-only": "vite build",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import type { Game, GraphNode, Teams } from './models'
|
import type { Game, GraphNode, Teams } from './models'
|
||||||
import { downloadData } from './qr'
|
import { downloadData } from './qr'
|
||||||
|
|
||||||
|
const API_URL = import.meta.env.VITE_API_URL;
|
||||||
|
|
||||||
export const apiGetTeams = async (): Promise<Teams> => {
|
export const apiGetTeams = async (): Promise<Teams> => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(getApiUrl('/teams'))
|
const response = await fetch(getApiUrl('/teams'))
|
||||||
@@ -129,6 +131,8 @@ export const updateNode = async (code: string, node: GraphNode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getApiUrl(path: string) {
|
function getApiUrl(path: string) {
|
||||||
// return 'http://' + window.location.host.split(':')[0] + ':8090' + path
|
if (API_URL === '') {
|
||||||
return 'https://evening-detective-api.crabs-games.art' + path
|
return 'http://' + window.location.host.split(':')[0] + ':8090' + path
|
||||||
|
}
|
||||||
|
return API_URL + path
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user