Skip to content

Commit d290a3c

Browse files
committed
Enable alpha version of backend
1 parent 2b76218 commit d290a3c

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

env/alpha

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PORT=61234
2+
HTTPS=true
3+
REACT_APP_BACKEND_SPECIFIC_API="https://alpha.opensist.tech/"

env/beta

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PORT=61234
2+
HTTPS=true

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@
4848
"zod": "3.22.4"
4949
},
5050
"scripts": {
51-
"start_win": "set PORT=61234 && react-scripts start",
52-
"start_unix": "export PORT=61234 HTTPS=true && react-scripts start",
53-
"build": "CI=false react-scripts build",
54-
"test": "react-scripts test",
55-
"eject": "臭小子别乱碰这个 react-scripts eject"
51+
"start:alpha": "dotenv -e env/alpha -- react-scripts start",
52+
"start:beta": "dotenv -e env/beta -- react-scripts start",
53+
"build": "CI=false react-scripts build"
5654
},
5755
"eslintConfig": {
5856
"extends": [
@@ -74,6 +72,7 @@
7472
},
7573
"devDependencies": {
7674
"@babel/plugin-proposal-private-property-in-object": "7.21.0",
75+
"dotenv-cli": "^8.0.0",
7776
"webpack": "5.94.0"
7877
}
7978
}

src/APIs/APIs.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
const ROOT = "https://opensist.tech/";
1+
const defaultRoot = "https://opensist.tech/";
2+
const ROOT = process.env.REACT_APP_BACKEND_SPECIFIC_API?.trim() || defaultRoot;
3+
if (ROOT !== defaultRoot) {
4+
console.log("Using Alpha API: " + ROOT);
5+
}
6+
27
export const PROGRAM_LIST = ROOT + "api/list/programs";
38
export const PROGRAM_DESC = ROOT + "api/query/program_description";
49
export const ADD_MODIFY_PROGRAM = ROOT + "api/mutating/new_modify_program";

0 commit comments

Comments
 (0)