added config
Some checks failed
Build and Push Docker Image / Build image (push) Has been cancelled

This commit is contained in:
ACoolName 2025-04-09 02:39:33 +03:00
parent 392bfcccaa
commit e81b7abd1a
7 changed files with 767 additions and 723 deletions

View File

@ -1,4 +1,4 @@
FROM node:alpine
FROM node:alpine as builder
EXPOSE 3000
WORKDIR /app
@ -9,9 +9,13 @@ COPY tsconfig.json .
RUN npm install
COPY --chmod=111 startup.sh .
COPY public public
COPY src src
ENTRYPOINT [ "/usr/bin/env", "./startup.sh" ]
RUN npm run build
FROM node:alpine
COPY --from=builder /app/build /opt/server
WORKDIR /opt/server
ENTRYPOINT [ "npx", "-y" , "serve", "-s", "/opt/server" ]

1
config.js Normal file
View File

@ -0,0 +1 @@
var API_URL = 'https://games.acooldomain.co'

803
package-lock.json generated

File diff suppressed because it is too large Load Diff

1
public/config.js Normal file
View File

@ -0,0 +1 @@
var API_URL = "http://localhost"

View File

@ -3,6 +3,7 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.svg"/>
<script type="text/javascript" src="%PUBLIC_URL%/config.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta

View File

@ -1,7 +1,7 @@
import axios, { AxiosInstance, AxiosResponse } from "axios";
import React, { Context, Dispatch, ReactNode, createContext, useContext, useState } from "react";
import { useLocation, Navigate } from "react-router-dom";
import Cookies from 'js-cookie'
import Cookies from 'js-cookie';
import { Box, Button, ButtonGroup, ButtonOwnProps, Modal, PaletteMode, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TextField } from "@mui/material";
import { Form } from "@rjsf/mui";
import validator from '@rjsf/validator-ajv8';
@ -86,10 +86,9 @@ export const getDesignTokens = (mode: PaletteMode) => ({
}
});
const API_URL = `${process.env.REACT_APP_API_SCHEME}://${process.env.REACT_APP_API_URL}`
const API_URL = (window as any).API_URL
axios.defaults.withCredentials = true
export const api: AxiosInstance = axios.create({
baseURL: API_URL,
withCredentials: true,
@ -171,7 +170,8 @@ function CustomField(props: WidgetProps){
{ label: 'Create', value: Permission.Create },
{ label: 'Admin', value: Permission.Admin },
{ label: 'Cloud', value: Permission.Cloud },
]}} registry={registry} value={convertNumber(props.value)} />
]
}} registry={registry} value={convertNumber(props.value)} />
}
if (options2 === null) {