Mizu start dev commands (#726)

* start dev commands

* env files

* no message
This commit is contained in:
lirazyehezkel 2022-01-31 12:05:50 +02:00 committed by GitHub
parent 4be7164f20
commit 2e5cf13b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

3
ui/.env.dev.basic Normal file
View File

@ -0,0 +1,3 @@
REACT_APP_OVERRIDE_WS_URL="ws://localhost:8899/ws"
REACT_APP_OVERRIDE_API_URL="http://localhost:8899/"
REACT_APP_OVERRIDE_IS_ENTERPRISE="false"

3
ui/.env.dev.enterprise Normal file
View File

@ -0,0 +1,3 @@
REACT_APP_OVERRIDE_WS_URL="ws://localhost:8899/ws"
REACT_APP_OVERRIDE_API_URL="http://localhost:8899/"
REACT_APP_OVERRIDE_IS_ENTERPRISE="true"

View File

@ -49,7 +49,8 @@
},
"scripts": {
"start": "craco start",
"start-ent": "./node_modules/.bin/env-cmd -f .env.enterprise craco start",
"start-dev": "./node_modules/.bin/env-cmd -f .env.dev.basic craco start",
"start-dev-ent": "./node_modules/.bin/env-cmd -f .env.dev.enterprise craco start",
"build": "./node_modules/.bin/env-cmd -f .env.basic craco build",
"build-ent": "BUILD_PATH='./build-ent' ./node_modules/.bin/env-cmd -f .env.enterprise craco build",
"test": "craco test",

View File

@ -1,12 +1,13 @@
import * as axios from "axios";
export const MizuWebsocketURL = window.location.protocol === 'https:' ? `wss://${window.location.host}/ws` : `ws://${window.location.host}/ws`;
export const MizuWebsocketURL = process.env.REACT_APP_OVERRIDE_WS_URL ? process.env.REACT_APP_OVERRIDE_WS_URL :
window.location.protocol === 'https:' ? `wss://${window.location.host}/ws` : `ws://${window.location.host}/ws`;
export const FormValidationErrorType = "formError";
const CancelToken = axios.CancelToken;
const apiURL =`${window.location.origin}/`;
const apiURL = process.env.REACT_APP_OVERRIDE_API_URL ? process.env.REACT_APP_OVERRIDE_API_URL : `${window.location.origin}/`;
export default class Api {
static instance;